diff --git a/src/Exception/General.php b/src/Exception/General.php index 082cd617..636ac5a8 100755 --- a/src/Exception/General.php +++ b/src/Exception/General.php @@ -66,9 +66,9 @@ public static function handleErrors($errno, $errstr = '', $errfile = '', $errlin try { throw new \ErrorException($errstr, $errno, 0, $errfile, $errline); } catch (\Throwable $th) { - $app = \Leaf\Config::get("app")["instance"]; + $app = \Leaf\Config::get('app')['instance']; - if ($app && $app->config("log.enabled")) { + if ($app && $app->config('log.enabled')) { $app->logger()->error($th); } @@ -186,9 +186,12 @@ protected static function exceptionMarkup($title, $body) */ public static function defaultDown() { - echo static::errorMarkup( - 'Oops!', - '

App is under maintainance, please check back soon.

' + (new \Leaf\Http\Response())->exit( + static::errorMarkup( + 'Oops!', + '

App is under maintainance, please check back soon.

' + ), + 503 ); } @@ -227,6 +230,9 @@ public static function defaultError($e = null) } } - echo self::errorMarkup('Oops!', '

A website error has occurred, our team has been notified.

'); + (new \Leaf\Http\Response())->exit( + self::errorMarkup('Oops!', '

A website error has occurred, our team has been notified.

'), + 500 + ); } }