-
Notifications
You must be signed in to change notification settings - Fork 144
Add an ErrorEvent. #53
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
Comments
You want this as a global error handler? Like will the event also fire for rejected promises? Would be good to check what the precedent is for this behavior |
As noted in the meeting, since the rest of the API uses callbacks, I don't think we should mixin events for consistency. |
API has changed a lot since this was filed. There are now two types of errors and they're surfaced in different ways. Non-fatal errors are detected synchronously in response to an API call and surfaced via exception. An example would be calling configure() or decode() with inputs that are missing required parameters. The state of the codec is not altered by these errors. Fatal errors are detected while decoding/encoding, surfaced via the error callback. Generally these are codec errors, often caused by corrupt input. Please open new issues for feedback on this design. |
It would be nice to add an
ErrorEvent
to nicely handle errors in the errorEventListener
. I understand with promises we can always reject Promise and throw errors that we cannot escape, but for other "minor" errors it's good to handle theonerror
EventListener. It will help us to distinguish different kinds of errors, temporary vs permanent, etc.Strawman proposal :
Somewhat related to #49
The text was updated successfully, but these errors were encountered: