From aa5c829fae13f0ab0c1ae92b83a9e8f68c4ea619 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Tue, 4 Nov 2025 13:35:15 +0800 Subject: [PATCH] Add missing file and line for Unhandled exception --- src/SPC/exception/ExceptionHandler.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SPC/exception/ExceptionHandler.php b/src/SPC/exception/ExceptionHandler.php index d784be71..df5e4bf0 100644 --- a/src/SPC/exception/ExceptionHandler.php +++ b/src/SPC/exception/ExceptionHandler.php @@ -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');