try {
echo static::html($e);
} catch (\Exception $ignore) {
- HTTP::sendStatusCode(500);
+ headers_sent() or HTTP::setResponseCode(500);
}
} else {
throw new \Exception($msg, $e);
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;
}
return $html;
}
-}
\ No newline at end of file
+}