dunno my own method names...
authorMichael Wallner <mike@php.net>
Fri, 20 Dec 2013 14:49:17 +0000 (15:49 +0100)
committerMichael Wallner <mike@php.net>
Fri, 20 Dec 2013 14:49:17 +0000 (15:49 +0100)
mdref/ExceptionHandler.php

index 0edf7289ad9e33111e18b04651a6481e8fed0d33..1c9b7da8a60474c09f9f505e06013e1a38a4b63b 100644 (file)
@@ -19,7 +19,7 @@ class ExceptionHandler
                        try {
                                echo static::html($e);
                        } catch (\Exception $ignore) {
-                               HTTP::sendStatusCode(500);
+                               headers_sent() or HTTP::setResponseCode(500);
                        }
                } else {
                        throw new \Exception($msg, $e);
@@ -39,7 +39,7 @@ class ExceptionHandler
                if ($e instanceof \http\Controller\Exception) {
                        $code = $e->getCode() ?: 500;
                        foreach ($e->getHeaders() as $key => $val) {
-                               HTTP::sendResponseHeader($key, $val);
+                               HTTP::setResponseHeader($key, $val);
                        }
                } else {
                        $code = 500;
@@ -55,4 +55,4 @@ class ExceptionHandler
                }
                return $html;
        }
-}
\ No newline at end of file
+}