Skip to content

Commit

Permalink
Merge pull request #21432 from nextcloud/fix/exception-getresult
Browse files Browse the repository at this point in the history
Fix invalid usage of \Exception::getResult
  • Loading branch information
nickvergessen authored Jun 16, 2020
2 parents 5e52c11 + 94a95ff commit 4cff3a3
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit 4cff3a3

Please sign in to comment.