-
Notifications
You must be signed in to change notification settings - Fork 262
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
The error leaks out from try/catch #513
Comments
👋 you're missing an await in the query I hope this helps other people hehe |
await will wait for the request to be executed and will not proceed to the execution of the next line |
Promise.race should have caught or handled error in this case, are you sure there was unhandledRejection or did error just get logged to console? |
Promise.race, as expected, async/await is enclosed in a try/catch block to intercept errors |
Are you sure there was unhandledRejection or did error just get logged to console? |
the application installs an unhandledRejection handler during initialization |
at this point, the handler is a postmortem conclusion and not a solution to the issue of error interception in a specific place |
@budarin I don't seem to be able to reproduce your issue, which I'm also a little unsure what it exactly is? Could you try to make a reproducible example showcasing what you get and what you expected? |
Because canceling a request after a certain time is impossible (technically difficult to implement), so I'm trying to arrange a request race with a timer and if the timer is triggered earlier, we return undefined, otherwise the result of the request
and in the database, a limit was set on the execution time of the statement
execute the code and get the error after getting the result from db:
Although it should not get errors at all because there has already been a return from this section of the code
In extreme cases, the code in the catch block should work and display an error in the log
how is it defined in my code above
how to avoid the occurrence of an uncontrolled exception?
The text was updated successfully, but these errors were encountered: