Exceptions not handled in cronjob functions added via SchedulerRegistry
simon1389 opened this issue · 3 comments
simon1389 commented
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
When adding a cronjob by using the SchedulerRegistry, exceptions occuring inside the cron-function are not handled and cause the app to exit.
In a previous commit this behavior was fixed when using the @Cron
annotation (0cdfe8f)
Minimum reproduction code
https://github.com/simon1389/nestjs-schedule-bug
Steps to reproduce
- npm start
- See the error on console and the application shutdown
Expected behavior
I expect the same behavior as when using the @Cron
syntax.
So the error should be catched.
Package version
2.1.0
NestJS version
9.0.0
Node.js version
16.17.1
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
No response
kamilmysliwiec commented
Would you like to create a PR for this issue?
simon1389 commented
PR opened 😃
kamilmysliwiec commented
Let's track this here #1084