summaryrefslogtreecommitdiff
path: root/modules/rest/libraries
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-02-02 02:59:20 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-02-02 02:59:20 +0000
commit9d0927dda936756f1f5003813f437d714fe481f8 (patch)
treefe1b887345b37387ab0ddcfd78bf344f6150b6cc /modules/rest/libraries
parenta6f794c20dc3592bcaef17c622413c1b670a20d8 (diff)
parent43985ea2fb137aa7d532617271e37d7c20def3c5 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
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