diff --git a/framework/core/src/Http/Server.php b/framework/core/src/Http/Server.php index b48a5e531..21e5bcca7 100644 --- a/framework/core/src/Http/Server.php +++ b/framework/core/src/Http/Server.php @@ -56,7 +56,24 @@ class Server try { return $this->site->bootApp(); } catch (Throwable $e) { - exit('Error booting Flarum: '.$e->getMessage()); + exit($this->formatBootException($e)); } } + + /** + * Display the most relevant information about an early exception. + */ + private function formatBootException(Throwable $error): string + { + $message = $error->getMessage(); + $file = $error->getFile(); + $line = $error->getLine(); + $type = get_class($error); + + return << + $message
+ thrown in $file on line $line +ERROR; + } }