If an error is thrown in a saga directly (not in a command handler further down the road) the app crashes unless there's a global process.on('uncaughtException').
If we do have process.on('uncaughtException') the app stays open, but any subsequent events do not trigger the same saga after the first time it throws an error.
These errors are not handled and are not forwarded to UnhandledExceptionBus.
Is there an existing issue for this?
Current behavior
If an error is thrown in a saga directly (not in a command handler further down the road) the app crashes unless there's a global
process.on('uncaughtException')
.If we do have
process.on('uncaughtException')
the app stays open, but any subsequent events do not trigger the same saga after the first time it throws an error.These errors are not handled and are not forwarded to
UnhandledExceptionBus
.Minimum reproduction code
https://github.com/LaurynasGr/nestjs-saga-error-demo
Steps to reproduce
Steps to reproduce in example repo README https://github.com/LaurynasGr/nestjs-saga-error-demo/tree/main?tab=readme-ov-file#setup
Expected behavior
Errors should be handled the same way as it is handled when thrown in command handlers (logged to console and pushed to
UnhandledExceptionBus
)Package version
10.2.8
NestJS version
10.0.0
Node.js version
22.9.0
In which operating systems have you tested?
Other
No response