You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any error occurring inside Promise is silent if I dont have try/catch or use .catch() after then() function.
In AngularJs there is a Service $q which handles promises but any error occurring inside promise is reported and logged in the console. But with Q service https://github.com/kriskowal/q I am not getting any log in the console if any error occurs inside.
I don't want to put .catch() after every then() function.
How to catch all unhandled exceptions in Promises
The text was updated successfully, but these errors were encountered:
stripathix
changed the title
Global Error handling in Prmises
Question : Global Error handling in Promise
Sep 24, 2018
You listen to the unhandledRejection event on process which gets called whenever a promise rejection was not handled for a microtick - listen to rejectionHandled to catch false positives. In browser environment there are similar events (I forgot how I called them in Q but you can define a global process event emitter).
Any error occurring inside Promise is silent if I dont have try/catch or use .catch() after then() function.
In AngularJs there is a Service $q which handles promises but any error occurring inside promise is reported and logged in the console. But with Q service https://github.com/kriskowal/q I am not getting any log in the console if any error occurs inside.
I don't want to put .catch() after every then() function.
How to catch all unhandled exceptions in Promises
The text was updated successfully, but these errors were encountered: