5 ms·
Since we're talking about promises ... can anyone point to some good patterns for nested promises and not losing errors to the either? Every time I use promise
by greggman 11y ago
Since we're talking about promises ... can anyone point to some good patterns for nested promises and not losing errors to the either?
Every time I use promises I find that I lose errors and it takes hours of adding console.logs all over the place until I find the place with the error some nested promise is hiding.
- inglor 11y agoHey! In NodeJS we added a handler that helps you with that here: https://nodejs.org/api/process.html#process_event_unhandledrejection https://nodejs.org/api/process.html#process_event_unhandledr... Here is a talk I gave about adding it last June: https://www.youtube.com/watch?v=LGpmUyFnyuQ https://www.youtube.com/watch?v=LGpmUyFnyuQ Personally, I recommend you use a faster richer userland library like Bluebird which has stronger unhandled rejection tracking.
- Too 11y agoChromes "break on exception"-option also breaks on unhandled promise reject().