use http\Env as HTTP;
+/**
+ * mdref exception handler
+ */
class ExceptionHandler
{
function __construct() {
return true;
}
+ /**
+ * Format an exception as HTML and send appropriate exception info as HTTP headers
+ * @param \Exception $e
+ * @param array $title_tag
+ * @param array $message_tag
+ * @param array $trace_tag
+ * @return string
+ */
static function html(\Exception $e, array $title_tag = ["h1"], array $message_tag = ["p"], array $trace_tag = ["pre", "style='font-size:smaller'"]) {
if ($e instanceof \http\Controller\Exception) {
$code = $e->getCode() ?: 500;