# HG changeset patch # User Marcin Kuzminski # Date 2018-09-25 19:09:31 # Node ID 7b8645d6dc0180afa507a46a8d3b0176769d7465 # Parent ea888de7b59da7c3a9bd9f8b4c18d38c3b8afe1f hooks: handle errors before trying to fetch the output. diff --git a/vcsserver/hooks.py b/vcsserver/hooks.py --- a/vcsserver/hooks.py +++ b/vcsserver/hooks.py @@ -143,8 +143,9 @@ 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) writer.write(result['output']) - _handle_exception(result) return result['status']