3 ms·
> I've never seen a production ready web framework or library that would let your entire process crash because of a bad request. Node does this (regardless of
by Aeolun 4y ago
> I've never seen a production ready web framework or library that would let your entire process crash because of a bad request.
Node does this (regardless of framework/server) if you have some unhandled promise rejection/error in an asynchronous function.
- gbuk2013 4y agoYou can catch these with Node but I wouldn’t do it - if it’s not explicitly handled then it’s either a bug or something really bad happened and the app needs to get alarm bells ringing.
- wruza 4y agoError recovery in long-running dynamic-y processes is nontrivial, especially for “programming errors”. While it can be done, much easier to stick to crashonly practices. Also helps in production where you can safely crash it and restart without worrying about stale something.
- fendy3002 4y agowhich can be handled easily with unhandledrejection. Though ideally, web frameworks such as NestJs is already handled the rejection on request level and can be override easily with Filters. Yeah I know express isn't handled, you'll need to handle it yourself.