diff --git a/src/mako/error/handlers/cli/DevelopmentHandler.php b/src/mako/error/handlers/cli/DevelopmentHandler.php
index 6aa7cf207..8743b9ae9 100644
--- a/src/mako/error/handlers/cli/DevelopmentHandler.php
+++ b/src/mako/error/handlers/cli/DevelopmentHandler.php
@@ -8,6 +8,7 @@
namespace mako\error\handlers\cli;
use ErrorException;
+use mako\cli\output\helpers\Alert;
use mako\cli\output\Output;
use mako\error\handlers\HandlerInterface;
use Throwable;
@@ -74,20 +75,25 @@ protected function determineExceptionType(Throwable $exception): string
*/
public function handle(Throwable $exception): mixed
{
- $type = $this->escape($this->determineExceptionType($exception));
+ $alert = (new Alert($this->output))->render(
+ "{$this->escape($this->determineExceptionType($exception))} [ {$exception->getCode()} ]",
+ Alert::DANGER,
+ Output::ERROR
+ );
- $message = $this->escape($exception->getMessage());
+ $info = "{$this->escape($exception->getMessage())}";
if (!empty($exception->getFile())) {
- $message .= PHP_EOL
+ $info .= PHP_EOL
. PHP_EOL
- . "Error location: {$this->escape($exception->getFile())}"
- . " on line {$this->escape($exception->getLine())}";
+ . "The error occured in {$this->escape($exception->getFile())}"
+ . " on line {$exception->getLine()}"
+ . PHP_EOL;
}
$trace = $this->escape($exception->getTraceAsString());
- $this->output->errorLn("{$type}: {$message}" . PHP_EOL . PHP_EOL . $trace . PHP_EOL . '');
+ $this->output->errorLn($alert . PHP_EOL . $info . PHP_EOL . $trace);
return false;
}