NestJS handling UnhandledPromiseRejection with exception filters

Viewed 614

In NestJS the standard approach of handling errors is to let errors propagate up to the exception filter(s) so that code is not littered with try-catch blocks and exception logging and error conversion can be performed in one place. With the move to node16, an event is thrown when there is no catch on a promise. This change seemingly leads to putting catch statements on all async calls. Is there a better approach that leverage the same exception filters methodology?

0 Answers
Related