pyzeebe
pyzeebe copied to clipboard
Raised exception in decorator should prevent further processing
Copying (with a little rephrasing) discussion from #131 to a new issue here.
Is your feature request related to a problem? Please describe. We should allow the user to control whether an exception should be ignored or not, if raised in a decorator.
E.g. I can't configure a decorator that if failing, it will stop the execution.
Describe the solution you'd like
If RecoverableDecoratorError is raised it will be ignored, all other exceptions are caught and raised in the decorator runner.
Describe alternatives you've considered
We could introduce a new exception type NoRecoverableDecoratorError that can be raised within a decorator, that will halt the execution.
Additional context Discussion in PR: https://github.com/JonatanMartens/pyzeebe/pull/131#discussion_r589365568