summaryrefslogtreecommitdiff
path: root/modules/rest/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rest/libraries')
-rw-r--r--modules/rest/libraries/Rest_Exception.php20
1 files changed, 7 insertions, 13 deletions
diff --git a/modules/rest/libraries/Rest_Exception.php b/modules/rest/libraries/Rest_Exception.php
index 905b94a0..c3548b7e 100644
--- a/modules/rest/libraries/Rest_Exception.php
+++ b/modules/rest/libraries/Rest_Exception.php
@@ -17,20 +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 {
- /**
- * Set internal properties.
- */
- public function __construct($code, $text) {
- parent::__construct("$code $text");
+class Rest_Exception_Core extends Kohana_Exception {
+ public function __construct($message, $code) {
+ parent::__construct($message, null, $code);
}
- /**
- * Sends the headers, to emulate server behavior.
- *
- * @return void
- */
public function sendHeaders() {
- header('HTTP/1.1 {$this->getMessage()}');
+ if (!headers_sent()) {
+ header("HTTP/1.1 " . $this->getCode() . " " . $this->getMessage());
+ }
}
-} // End Rest Exception \ No newline at end of file
+} \ No newline at end of file