# HG changeset patch # User RhodeCode Admin # Date 2024-10-11 08:45:27 # Node ID 4ef2409ac6cbc7409478e4055d48ff19a281a16a # Parent 99fe36de1e5e6b52b7eb881e681c98c3ad70c9b4 fix: skip process exception is there isn't one diff --git a/vcsserver/hooks.py b/vcsserver/hooks.py --- a/vcsserver/hooks.py +++ b/vcsserver/hooks.py @@ -107,7 +107,9 @@ class HooksCeleryClient: inquired_task = self.celery_app.signature( f'rhodecode.lib.celerylib.tasks.{method}' ) - return inquired_task.delay(extras).get(timeout=self.TASK_TIMEOUT) + result = inquired_task.delay(extras).get(timeout=self.TASK_TIMEOUT) + + return result class HooksShadowRepoClient: @@ -157,9 +159,11 @@ class SvnMessageWriter(RemoteMessageWrit self.stderr.write(message) -def _handle_exception(result): +def _maybe_handle_exception(result): exception_class = result.get('exception') exception_traceback = result.get('exception_traceback') + if not (exception_class and exception_traceback): + return log.debug('Handling hook-call exception: %s', exception_class) if exception_traceback: @@ -200,7 +204,7 @@ def _call_hook(hook_name, extras, writer log.debug('Hooks, using client:%s', hooks_client) result = hooks_client(hook_name, extras) log.debug('Hooks got result: %s', result) - _handle_exception(result) + _maybe_handle_exception(result) writer.write(result['output']) return result['status']