Adding error code checking around CakeException handling

SocketExceptions can have error codes outside of the HTTP values.
This commit is contained in:
mark_story 2011-09-26 22:00:58 -04:00
parent 2bce6149e9
commit 421a2116be

View file

@ -179,7 +179,7 @@ class ExceptionRenderer {
*/ */
protected function _cakeError(CakeException $error) { protected function _cakeError(CakeException $error) {
$url = $this->controller->request->here(); $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->response->statusCode($code);
$this->controller->set(array( $this->controller->set(array(
'code' => $code, 'code' => $code,