Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reject/throw as appropriate in ES6 exported methods if window.fdc3 is not available #277

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

mattjamieson
Copy link
Contributor

Improve error handling in exported methods by:

  • rejecting with the message 'FDC3 DesktopAgent not available at 'window.fdc3'. if the method returns a Promise (e.g. open), and
  • throwing with the same message if the method is synchronous (e.g. broadcast).

At present, developers would see the significantly less helpful:

Uncaught TypeError: Cannot read property 'broadcast' of undefined

This can be improved further in future by leveraging the ready event pattern proposed in #269.

Copy link
Contributor

@rikoe rikoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@mattjamieson mattjamieson force-pushed the feature/es6-method-error-handling branch from fdd1a6e to 452a105 Compare January 26, 2021 21:00
@rikoe rikoe merged commit 1375156 into finos:master Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants