Skip to content

Commit

Permalink
handle errors showing tracebacks better
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Dec 19, 2012
1 parent c3e75cc commit d675d67
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions master/buildbot/process/buildstep.py
Expand Up @@ -684,26 +684,29 @@ def failed(self, why):
try:
if self.progress:
self.progress.finish()
self.addHTMLLog("err.html", formatFailure(why))
self.addCompleteLog("err.text", why.getTraceback())
try:
self.addCompleteLog("err.text", why.getTraceback())
self.addHTMLLog("err.html", formatFailure(why))
except Exception:
log.err(Failure(), "error while formatting exceptions")

# could use why.getDetailedTraceback() for more information
self.step_status.setText([self.name, "exception"])
self.step_status.setText2([self.name])
self.step_status.stepFinished(EXCEPTION)

hidden = self._maybeEvaluate(self.hideStepIf, EXCEPTION, self)
self.step_status.setHidden(hidden)
except:
log.msg("exception during failure processing")
log.err()
except Exception:
log.err(Failure(), "exception during failure processing")
# the progress stuff may still be whacked (the StepStatus may
# think that it is still running), but the build overall will now
# finish

try:
self.releaseLocks()
except:
log.msg("exception while releasing locks")
log.err()
except Exception:
log.err(Failure(), "exception while releasing locks")

log.msg("BuildStep.failed now firing callback")
self.deferred.callback(EXCEPTION)
Expand Down

0 comments on commit d675d67

Please sign in to comment.