Browse files

Adding error code checking around CakeException handling

SocketExceptions can have error codes outside of the HTTP values.
  • Loading branch information...
1 parent 2bce614 commit 421a2116be49e9b6218278cf460ca05469a7923b @markstory markstory committed Sep 26, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Error/ExceptionRenderer.php
View
2 lib/Cake/Error/ExceptionRenderer.php
@@ -179,7 +179,7 @@ public function render() {
*/
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,

0 comments on commit 421a211

Please sign in to comment.