error handling like in other webhooks

This commit is contained in:
Sami Tikka 2013-10-17 11:53:08 +03:00
parent 6b63e47cfd
commit 3d8be0e218

View file

@ -50,8 +50,17 @@ class GitController extends \PHPCI\Controller
$build->setStatus(0);
$build->setLog('');
$build->setCreated(new \DateTime());
$this->_buildStore->save($build);
} catch (\Exception $ex) {
header('HTTP/1.1 400 Bad Request');
header('Ex: ' . $ex->getMessage());
die('FAIL');
}
try {
$this->_buildStore->save($build);
} catch (\Exception $ex) {
header('HTTP/1.1 500 Internal Server Error');
header('Ex: ' . $ex->getMessage());
die('FAIL');
}