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

Event callbacks are catching and ignoring my errors #706

Open
ffxsam opened this issue Mar 23, 2021 · 1 comment
Open

Event callbacks are catching and ignoring my errors #706

ffxsam opened this issue Mar 23, 2021 · 1 comment

Comments

@ffxsam
Copy link

ffxsam commented Mar 23, 2021

Expected Behavior

If I make mistakes in my own code (within the event callbacks), I'd expect to see an error in my console.

Actual Behavior

I see no errors because the processData function is catching & ignoring errors.

Steps to Reproduce

player.on('play', () => {
  throw new Error('unseen error');
});
@ffxsam ffxsam changed the title Don't catch errors and ignore them in event callbacks Event callbacks are catching and ignoring my errors Mar 23, 2021
@bdougherty
Copy link
Member

I'm not sure what options are available to us here. We need to catch the error when running the callbacks, or subsequent ones will not run. I don't think we can re-dispatch that event on window like what would happen with an EventTarget. Maybe we can extend EventTarget and use that mechanism instead. Not sure when we'd be able to do that work, though.

I'm open to other ideas too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants