diff options
Diffstat (limited to 'k8s/k8splugin/decorators.py')
-rw-r--r-- | k8s/k8splugin/decorators.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/k8s/k8splugin/decorators.py b/k8s/k8splugin/decorators.py index 2edcc0d..59d14d8 100644 --- a/k8s/k8splugin/decorators.py +++ b/k8s/k8splugin/decorators.py @@ -98,3 +98,17 @@ def merge_inputs_for_start(task_start_func): ctx.instance.runtime_properties, **kwargs) return wrapper + +def wrap_error_handling_update(update_func): + """ Wrap error handling for update operations (scale and upgrade) """ + + def wrapper(**kwargs): + try: + return update_func(**kwargs) + except DockerPluginDeploymentError: + raise NonRecoverableError ("Update operation did not complete successfully in the alloted time") + except Exception as e: + ctx.logger.error ("Unexpected error during update operation: {0}".format(str(e))) + raise NonRecoverableError(e) + + return wrapper
\ No newline at end of file |