error handling like in other webhooks
This commit is contained in:
parent
6b63e47cfd
commit
3d8be0e218
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue