From 299759b8369421d816bff8c6587e66051444cee9 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Thu, 29 Aug 2019 17:18:39 +0200 Subject: Handle throwables in the http dispatcher MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Arthur Schiwon Signed-off-by: Julius Härtl --- lib/private/AppFramework/Http/Dispatcher.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/private/AppFramework/Http/Dispatcher.php b/lib/private/AppFramework/Http/Dispatcher.php index 7b9ad015de6..0b9422f9fc9 100644 --- a/lib/private/AppFramework/Http/Dispatcher.php +++ b/lib/private/AppFramework/Http/Dispatcher.php @@ -105,6 +105,10 @@ class Dispatcher { } catch(\Exception $exception){ $response = $this->middlewareDispatcher->afterException( $controller, $methodName, $exception); + } catch(\Throwable $throwable) { + $exception = new \Exception($throwable->getMessage(), $throwable->getCode(), $throwable); + $response = $this->middlewareDispatcher->afterException( + $controller, $methodName, $exception); } $response = $this->middlewareDispatcher->afterController( -- cgit v1.2.3