mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding error code checking around CakeException handling
SocketExceptions can have error codes outside of the HTTP values.
This commit is contained in:
parent
2bce6149e9
commit
421a2116be
1 changed files with 1 additions and 1 deletions
|
@ -179,7 +179,7 @@ class ExceptionRenderer {
|
|||
*/
|
||||
protected function _cakeError(CakeException $error) {
|
||||
$url = $this->controller->request->here();
|
||||
$code = $error->getCode();
|
||||
$code = ($error->getCode() >= 400 && $error->getCode() < 506) ? $error->getCode() : 500;
|
||||
$this->controller->response->statusCode($code);
|
||||
$this->controller->set(array(
|
||||
'code' => $code,
|
||||
|
|
Loading…
Reference in a new issue