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

"Always dies on uncaught errors." #12

Closed
benjamingr opened this issue May 30, 2018 · 3 comments
Closed

"Always dies on uncaught errors." #12

benjamingr opened this issue May 30, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@benjamingr
Copy link
Contributor

What do you do with unhandled promise rejections?

@ry
Copy link
Member

ry commented May 30, 2018

I forward them to window.onerror for possible source map modification of the stack trace, and then exit the process.
https://github.com/ry/v8worker2/blob/d2017b36edb8429471b08b27123981f1abd5fcb0/binding.cc#L61-L91

@benjamingr
Copy link
Contributor Author

benjamingr commented May 30, 2018

@ry I think that literally exits when a promise is rejected though:

Namely:

const p = makePromise(); // if `p` is rejected synchronously then the process will exit
await 3; // or something else that just waits but not for I/O
p.catch(() => {}); // or await

It is also fine to ask users to handle all promise rejections "synchronously" - it deviates from web behaviour and I think that if this is intentional then it should be documented.

@qti3e qti3e added the bug Something isn't working label Jun 1, 2018
@benjamingr
Copy link
Contributor Author

Following our discussion - we should document the expectation of handling rejections synchronously and keep the current V8 semantic.

I'm going to close this - and follow up with either a docs or code PR (depending on the project state) in 2-3 weeks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants