javascript - Crashing the application from within a Q promise instead of propagate a rejection through a chain of promises? -


so problem q swallows exceptions not meant reject promises, crash application possible, know broken.

i know can (and should) use done method @ end of chain, it's pain in butt keep track of chain ends. , doesn't because doesn't prevent q catching , once cached exception looses it's stack trace.

is there way crash when exception thrown rather propagate rejection chain hoping there done @ end of it?

right, pr q got merged, can this:

process.on("unhandledrejection", function(err, promise){     throw err; // terminate error if `.catch` not attached }); 

which cause process exit whenever exception not explicitly handled (via catch). ends long saga of debugging issues promises. gone days of .done.

just make sure q 1.30, released 6 minutes ago :d


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -