Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ocs
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-06-16 16:37:20 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-06-16 22:26:44 +0300
commit97f3e9d39122ee4b727abd904c1a90ae90a0c730 (patch)
treea44b2954a5791f7327eea1e76ffd6d268a1360f7 /ocs
parentc9f0f5a0d9dbd5a23db84233ee9138534f344e1a (diff)
Fix invalid usage of \Exception::getResult
Only OCS exceptions have a getResult method. Any other exception will cause another error due to this invalid method call. This splits the catch into a specific one for OCS and then a generic one for anything else that can't be handled. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'ocs')
-rw-r--r--ocs/v1.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/ocs/v1.php b/ocs/v1.php
index 983bfd5f77d..0c24aa814eb 100644
--- a/ocs/v1.php
+++ b/ocs/v1.php
@@ -67,9 +67,15 @@ try {
OC_API::setContentType();
http_response_code(405);
exit();
-} catch (Exception $ex) {
+} catch (\OC\OCS\Exception $ex) {
OC_API::respond($ex->getResult(), OC_API::requestedFormat());
exit();
+} catch (Throwable $ex) {
+ OC::$server->getLogger()->logException($ex);
+
+ OC_API::setContentType();
+ http_response_code(500);
+ exit();
}
/*