Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
  • Loading branch information
ChristophWurst committed Jun 16, 2020
commit 94a95ffceb0ec16b333d13a0742a5e0c2c1ed93e
8 changes: 7 additions & 1 deletion ocs/v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,15 @@
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();
}

/*
Expand Down