Browse Source

Adding error code checking around CakeException handling
SocketExceptions can have error codes outside of the HTTP values.

mark_story 14 years ago
parent
commit
421a2116be
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/Cake/Error/ExceptionRenderer.php

+ 1 - 1
lib/Cake/Error/ExceptionRenderer.php

@@ -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,