summaryrefslogtreecommitdiff
path: root/modules/rest
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rest')
-rw-r--r--modules/rest/libraries/Rest_Exception.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/rest/libraries/Rest_Exception.php b/modules/rest/libraries/Rest_Exception.php
index 596b3712..c3548b7e 100644
--- a/modules/rest/libraries/Rest_Exception.php
+++ b/modules/rest/libraries/Rest_Exception.php
@@ -17,5 +17,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class Rest_Exception_Core extends Exception {
+class Rest_Exception_Core extends Kohana_Exception {
+ public function __construct($message, $code) {
+ parent::__construct($message, null, $code);
+ }
+
+ public function sendHeaders() {
+ if (!headers_sent()) {
+ header("HTTP/1.1 " . $this->getCode() . " " . $this->getMessage());
+ }
+ }
} \ No newline at end of file