diff --git a/~dev_rating/application/classes/Controller/Handler.php b/~dev_rating/application/classes/Controller/Handler.php index 75f4b38ae10b17224beb0bcce6002932c9b41d43..62b501c031505dc121bbb01a85464918f878d00a 100644 --- a/~dev_rating/application/classes/Controller/Handler.php +++ b/~dev_rating/application/classes/Controller/Handler.php @@ -26,7 +26,7 @@ class Controller_Handler extends Controller return $res; } - protected function fail() { - throw HTTP_Exception::factory(422)->request($this->request); + protected function fail($message = null) { + throw HTTP_Exception::factory(422, $message)->request($this->request); } } diff --git a/~dev_rating/system/classes/Kohana/HTTP/Exception/Expected.php b/~dev_rating/system/classes/Kohana/HTTP/Exception/Expected.php index 4d08def2fa74bd6c03f2f439ae8ef3049f37df55..920c83098e8d70404a408eeea12aa5cd968fe65c 100644 --- a/~dev_rating/system/classes/Kohana/HTTP/Exception/Expected.php +++ b/~dev_rating/system/classes/Kohana/HTTP/Exception/Expected.php @@ -35,6 +35,9 @@ abstract class Kohana_HTTP_Exception_Expected extends HTTP_Exception { // Prepare our response object and set the correct status code. $this->_response = Response::factory() ->status($this->_code); + + if (!is_null($message)) + $this->_response->body($message); } /** diff --git a/~dev_rating/system/classes/Kohana/Response.php b/~dev_rating/system/classes/Kohana/Response.php index 67abf2d7aaf5c7b83b014f363b24b5f8c0d3043c..111532bf4e6d16bcc82f61cba8f8370b29650799 100644 --- a/~dev_rating/system/classes/Kohana/Response.php +++ b/~dev_rating/system/classes/Kohana/Response.php @@ -196,7 +196,7 @@ class Kohana_Response implements HTTP_Response { * $status = $response->status(); * * @param integer $status Status to set to this response - * @return mixed + * @return self|mixed */ public function status($status = NULL) {