Skip to content

Commit

Permalink
Print detailed information if _dovccmd() in GitPoller fails
Browse files Browse the repository at this point in the history
Otherwise the outputted information often isn't sufficient to debug the
problem.
  • Loading branch information
Hnasar authored and Xavier Delannoy committed Dec 10, 2014
1 parent 663b639 commit bf7017c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions master/buildbot/changes/gitpoller.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,18 @@ def _dovccmd(self, command, args, path=None):
d = utils.getProcessOutputAndValue(self.gitbin,
[command] + args, path=path, env=os.environ)

def _convert_nonzero_to_failure(res):
def _convert_nonzero_to_failure(res,
command,
args,
path):
"utility to handle the result of getProcessOutputAndValue"
(stdout, stderr, code) = res
if code != 0:
raise EnvironmentError('command on repourl %s failed with exit code %d: %s'
% (self.repourl, code, stderr))
raise EnvironmentError('command %s %s in %s on repourl %s failed with exit code %d: %s'
% (command, args, path, self.repourl, code, stderr))
return stdout.strip()
d.addCallback(_convert_nonzero_to_failure)
d.addCallback(_convert_nonzero_to_failure,
command,
args,
path)
return d

0 comments on commit bf7017c

Please sign in to comment.