Adding global try/catch in Builder, in hope of fixing forever-hanging. Closes #354, Closes #304

This commit is contained in:
Dan Cryer 2014-04-16 09:05:46 +01:00
parent 686783534c
commit 6513454265

View file

@ -188,6 +188,7 @@ class Builder implements LoggerAwareInterface
$this->build->sendStatusPostback();
$this->success = true;
try {
// Set up the build:
$this->setupBuild();
@ -223,6 +224,11 @@ class Builder implements LoggerAwareInterface
$cmd = 'rmdir /S /Q "%s"';
}
$this->executeCommand($cmd, $this->buildPath);
} catch (\Exception $ex) {
$this->build->setStatus(Build::STATUS_FAILED);
$this->buildLogger->logFailure('Exception: ' . $ex->getMessage());
}
// Update the build in the database, ping any external services, etc.
$this->build->sendStatusPostback();