Skip to content

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