diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-03-13 12:13:57 +0100 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2017-03-24 11:06:44 +0100 |
commit | 4531b4a81da81c8f1b6eb49b2669fa93088e33d9 (patch) | |
tree | 264d46d9316e42cb73ec8641198e08f8a9883867 /apps/federation/lib | |
parent | faf836b0c0f94348380e1b0c965d3ea75fa1482d (diff) | |
download | nextcloud-server-4531b4a81da81c8f1b6eb49b2669fa93088e33d9.tar.gz nextcloud-server-4531b4a81da81c8f1b6eb49b2669fa93088e33d9.zip |
only execute code if exception was thrown by the corresponding controller
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/federation/lib')
-rw-r--r-- | apps/federation/lib/Middleware/AddServerMiddleware.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/federation/lib/Middleware/AddServerMiddleware.php b/apps/federation/lib/Middleware/AddServerMiddleware.php index d920aee3e4e..71e517f6b87 100644 --- a/apps/federation/lib/Middleware/AddServerMiddleware.php +++ b/apps/federation/lib/Middleware/AddServerMiddleware.php @@ -25,6 +25,7 @@ namespace OCA\Federation\Middleware; use OC\HintException; +use OCA\Federation\Controller\SettingsController; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Middleware; @@ -57,6 +58,9 @@ class AddServerMiddleware extends Middleware { * @return JSONResponse */ public function afterException($controller, $methodName, \Exception $exception) { + if (($controller instanceof SettingsController) === false) { + throw $exception; + } $this->logger->error($exception->getMessage(), ['app' => $this->appName]); if ($exception instanceof HintException) { $message = $exception->getHint(); |