You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if a deferred function raises an exception in the DeferrerPlugin, subsequent deferred functions are not executed, and no error information is logged. This behavior can lead to silent failures, making it difficult to diagnose issues and ensuring that some deferred actions are not performed. This feature request proposes adding error handling to ensure that, if a deferred function fails, the error is logged, and the remaining deferred functions are still executed. Additionally, users should have the option to configure whether execution should stop or continue when an error occurs in a deferred function.
Proposed Solution:
Error Handling:
Modify the DeferrerPlugin to catch exceptions when executing deferred functions. If an exception is raised by a function or coroutine, the plugin should log the error, including details about the function and the exception. Despite the error, execution of subsequent deferred functions should continue.
Optional Configuration:
Add a configuration option to allow users to control whether the plugin should continue or stop execution if a deferred function raises an exception:
--defer-stop-on-error (default: False): When set to True, the plugin should stop executing deferred functions upon encountering an error. When set to False, the plugin should log the error and continue executing the remaining deferred functions.
Logging:
If a deferred function fails, log the function name, arguments, and the exception traceback for easier debugging.
Example Usage:
Command-line usage:
vedro run --defer-stop-on-error
This option will cause the plugin to stop executing remaining deferred functions if one fails.
Configuration via plugin setup:
classCustomDeferrer(Deferrer):
defer_stop_on_error=True# Stop execution on error
Error logging example:
ERROR: Deferred function <function_name> failed with arguments: (arg1, arg2), kwargs: {key: value}.
Traceback (most recent call last):
...
The text was updated successfully, but these errors were encountered:
Summary:
Currently, if a deferred function raises an exception in the
DeferrerPlugin
, subsequent deferred functions are not executed, and no error information is logged. This behavior can lead to silent failures, making it difficult to diagnose issues and ensuring that some deferred actions are not performed. This feature request proposes adding error handling to ensure that, if a deferred function fails, the error is logged, and the remaining deferred functions are still executed. Additionally, users should have the option to configure whether execution should stop or continue when an error occurs in a deferred function.Proposed Solution:
Error Handling:
Modify the
DeferrerPlugin
to catch exceptions when executing deferred functions. If an exception is raised by a function or coroutine, the plugin should log the error, including details about the function and the exception. Despite the error, execution of subsequent deferred functions should continue.Optional Configuration:
Add a configuration option to allow users to control whether the plugin should continue or stop execution if a deferred function raises an exception:
--defer-stop-on-error
(default:False
): When set toTrue
, the plugin should stop executing deferred functions upon encountering an error. When set toFalse
, the plugin should log the error and continue executing the remaining deferred functions.Logging:
If a deferred function fails, log the function name, arguments, and the exception traceback for easier debugging.
Example Usage:
Command-line usage:
This option will cause the plugin to stop executing remaining deferred functions if one fails.
Configuration via plugin setup:
Error logging example:
The text was updated successfully, but these errors were encountered: