Skip to content

Commit

Permalink
Adding error code checking around CakeException handling
Browse files Browse the repository at this point in the history
SocketExceptions can have error codes outside of the HTTP values.
  • Loading branch information
markstory committed Sep 28, 2011
1 parent 2bce614 commit 421a211
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Error/ExceptionRenderer.php
Expand Up @@ -179,7 +179,7 @@ public function render() {
*/ */
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,
Expand Down

0 comments on commit 421a211

Please sign in to comment.