I've added an error handling method in the CronJob class and added it to the constructors parameters. This error handling method will be called if any exception is thrown from the onTick method. Also added two new tests to confirm that it works.
Related Issue
Closes #426.
Motivation and Context
If any kind of exception occurs from the onTick method the whole process stops currently. To solve this, this feature will allow users to pass their own error handler when exceptions occur.
How Has This Been Tested?
Added two new test cases called should catch errors if errorhandler is provided & should throw errors if errorhandler is NOT provided
Screenshots (if appropriate):
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project.
[x] My change requires a change to the documentation.
[x] I have updated the documentation accordingly.
[x] I have added tests to cover my changes.
[x] All new and existing tests passed.
[ ] If my change introduces a breaking change, I have added a ! after the type/scope in the title (see the Conventional Commits standard).
Description
I've added an error handling method in the
CronJob
class and added it to the constructors parameters. This error handling method will be called if any exception is thrown from theonTick
method. Also added two new tests to confirm that it works.Related Issue
Closes #426.
Motivation and Context
If any kind of exception occurs from the
onTick
method the whole process stops currently. To solve this, this feature will allow users to pass their own error handler when exceptions occur.How Has This Been Tested?
Added two new test cases called
should catch errors if errorhandler is provided
&should throw errors if errorhandler is NOT provided
Screenshots (if appropriate):
Types of changes
Checklist:
!
after the type/scope in the title (see the Conventional Commits standard).