summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Http/Dispatcher.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/AppFramework/Http/Dispatcher.php')
-rw-r--r--lib/private/AppFramework/Http/Dispatcher.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/private/AppFramework/Http/Dispatcher.php b/lib/private/AppFramework/Http/Dispatcher.php
index 7b9ad015de6..6a04de76adc 100644
--- a/lib/private/AppFramework/Http/Dispatcher.php
+++ b/lib/private/AppFramework/Http/Dispatcher.php
@@ -27,19 +27,17 @@ declare(strict_types=1);
*
*/
-
namespace OC\AppFramework\Http;
-use \OC\AppFramework\Middleware\MiddlewareDispatcher;
-use \OC\AppFramework\Http;
-use \OC\AppFramework\Utility\ControllerMethodReflector;
+use OC\AppFramework\Http;
+use OC\AppFramework\Middleware\MiddlewareDispatcher;
+use OC\AppFramework\Utility\ControllerMethodReflector;
use OCP\AppFramework\Controller;
-use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Http\DataResponse;
+use OCP\AppFramework\Http\Response;
use OCP\IRequest;
-
/**
* Class to dispatch the request to the middleware dispatcher
*/
@@ -105,6 +103,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(