Skip to content

Commit aa5c829

Browse files
committed
Add missing file and line for Unhandled exception
1 parent fc118d7 commit aa5c829

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/SPC/exception/ExceptionHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ public static function handleSPCException(SPCException $e): void
159159
public static function handleDefaultException(\Throwable $e): void
160160
{
161161
$class = get_class($e);
162-
self::logError("✗ Unhandled exception {$class}:\n\t{$e->getMessage()}\n");
162+
$file = $e->getFile();
163+
$line = $e->getLine();
164+
self::logError("✗ Unhandled exception {$class} on {$file} line {$line}:\n\t{$e->getMessage()}\n");
163165
self::logError('Stack trace:');
164166
self::logError(ConsoleColor::gray($e->getTraceAsString()) . PHP_EOL, 4);
165167
self::logError('⚠ Please report this exception to: https://github.com/crazywhalecc/static-php-cli/issues');

0 commit comments

Comments
 (0)