From 299759b8369421d816bff8c6587e66051444cee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 29 Aug 2019 17:18:39 +0200 Subject: [PATCH] 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(+) diff --git a/lib/private/AppFramework/Http/Dispatcher.php b/lib/private/AppFramework/Http/Dispatcher.php index 7b9ad015de..0b9422f9fc 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(