From e1c4b648d116befc202d1b8059ffc806e494248d Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 21 Sep 2021 10:28:26 +0200 Subject: Improve syntax error reporting In some cases the error information is not enough to debug it. Before: syntax error, unexpected '<<' (T_SL) /var/www/html/lib/private/AppFramework/Http/Dispatcher.php 158 After: syntax error, unexpected '<<' (T_SL) in file '/var/www/html/apps/groupfolders/lib/Mount/GroupFolderStorage.php' line 88 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php 158 Signed-off-by: Carl Schwan --- lib/private/AppFramework/Http/Dispatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/private/AppFramework/Http') diff --git a/lib/private/AppFramework/Http/Dispatcher.php b/lib/private/AppFramework/Http/Dispatcher.php index 6ef7bba4fd6..6bbab42cb79 100644 --- a/lib/private/AppFramework/Http/Dispatcher.php +++ b/lib/private/AppFramework/Http/Dispatcher.php @@ -155,7 +155,7 @@ class Dispatcher { $response = $this->middlewareDispatcher->afterException( $controller, $methodName, $exception); } catch (\Throwable $throwable) { - $exception = new \Exception($throwable->getMessage(), $throwable->getCode(), $throwable); + $exception = new \Exception($throwable->getMessage() . ' in file \'' . $throwable->getFile() . '\' line ' . $throwable->getLine(), $throwable->getCode(), $throwable); $response = $this->middlewareDispatcher->afterException( $controller, $methodName, $exception); } -- cgit v1.2.3