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

Unhandled promise #106

Closed
sm2017 opened this issue Nov 30, 2017 · 4 comments
Closed

Unhandled promise #106

sm2017 opened this issue Nov 30, 2017 · 4 comments

Comments

@sm2017
Copy link

sm2017 commented Nov 30, 2017

I think it's good that we have a method like set_exception_handler for promise that sets a user-defined unhandled promise rejection handler function

@kelunik
Copy link

kelunik commented Nov 30, 2017

While sometimes useful, it could also be unhelpful in other situations. Imagine situations where something is fetched and the promise is resolved with an object, but that object provides access to further promise operations, which are executed eagerly, so there might be no interest in these promises at all, whether they succeed or fail. What's your suggestion to mark these as "not interested"?

@sm2017
Copy link
Author

sm2017 commented Nov 30, 2017

Unhanded promise rejection in asynchronous programing is same as uncaught exception in synchronous programming. Is there any "not interested" for set_exception_handler?

exception_handler is a function to be called when an uncaught exception occurs. You can have many exception types and in handler function ignore some types (using instance of operator)

In JavaScript we have same solution . see https://stackoverflow.com/questions/31472439/catch-all-unhandled-javascript-promise-rejections

@jsor
Copy link
Member

jsor commented Dec 1, 2017

I'm planning of introducing something like this in the future, see also #87.

@clue
Copy link
Member

clue commented Apr 5, 2021

Closing as duplicate of #87.

@clue clue closed this as completed Apr 5, 2021
@clue clue closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants