Skip to content

Commit a1d45c1

Browse files
committed
refactor: improve error message
1 parent ae1c187 commit a1d45c1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

system/Debug/BaseExceptionHandler.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,14 @@ protected static function highlightFile(string $file, int $lineNumber, int $line
245245
*/
246246
protected function render(Throwable $exception, int $statusCode, $viewFile = null): void
247247
{
248-
if (empty($viewFile) || ! is_file($viewFile)) {
249-
echo 'The error view files were not found. Cannot render exception trace.';
248+
if ($viewFile === null) {
249+
echo 'The error view file was not specified. Cannot display error view.';
250+
251+
exit(1);
252+
}
253+
254+
if (! is_file($viewFile)) {
255+
echo 'The error view file "' . $viewFile . '" was not found. Cannot display error view.';
250256

251257
exit(1);
252258
}

0 commit comments

Comments
 (0)