diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-05-19 11:41:55 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-05-19 11:44:02 +0100 |
commit | e0037c54412a56819c6490977f8b16bd507434ef (patch) | |
tree | aa640d1d8a13876d7560f961f9148c512ebceddf | |
parent | 224f61bf57da11af21dd3098eb8a46acbca8160a (diff) | |
download | zuul-baserock/sam/tweaks.tar.gz |
Give actual error message when getting a change from Gerrit failsbaserock/sam/tweaks
This makes it easier to debug configuration errors when using the `zuul`
commandline tool.
For example, if your zuul.conf points to an SSH key that doesn't exist,
the error you would get before would be:
zuul.rpcclient.RPCFailure: Invalid change: 37,1
The error you get after this patch is:
zuul.rpcclient.RPCFailure: Invalid change: 37,1 ([Errno 2]
No such file or directory: '/root/.ssh/id_rsa')
-rw-r--r-- | zuul/rpclistener.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zuul/rpclistener.py b/zuul/rpclistener.py index 05b8d033e..d6d791663 100644 --- a/zuul/rpclistener.py +++ b/zuul/rpclistener.py @@ -110,8 +110,8 @@ class RPCListener(object): event.change_number, event.patch_number = args['change'].split(',') try: pipeline.source.getChange(event, project) - except Exception: - errors += 'Invalid change: %s\n' % (args['change'],) + except Exception as e: + errors += 'Invalid change: %s (%s)\n' % (args['change'], e) if errors: job.sendWorkException(errors.encode('utf8')) |