Add missing file and line for Unhandled exception

This commit is contained in:
crazywhalecc 2025-11-04 13:35:15 +08:00
parent fc118d709e
commit aa5c829fae
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

View File

@ -159,7 +159,9 @@ class ExceptionHandler
public static function handleDefaultException(\Throwable $e): void
{
$class = get_class($e);
self::logError("✗ Unhandled exception {$class}:\n\t{$e->getMessage()}\n");
$file = $e->getFile();
$line = $e->getLine();
self::logError("✗ Unhandled exception {$class} on {$file} line {$line}:\n\t{$e->getMessage()}\n");
self::logError('Stack trace:');
self::logError(ConsoleColor::gray($e->getTraceAsString()) . PHP_EOL, 4);
self::logError('⚠ Please report this exception to: https://github.com/crazywhalecc/static-php-cli/issues');