Skip to content

Commit a436df0

Browse files
authored
Merge pull request #21441 from nextcloud/backport/21432/stable19
[stable19] Fix invalid usage of \Exception::getResult
2 parents 556bc6a + 97f3e9d commit a436df0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ocs/v1.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,15 @@
6767
OC_API::setContentType();
6868
http_response_code(405);
6969
exit();
70-
} catch (Exception $ex) {
70+
} catch (\OC\OCS\Exception $ex) {
7171
OC_API::respond($ex->getResult(), OC_API::requestedFormat());
7272
exit();
73+
} catch (Throwable $ex) {
74+
OC::$server->getLogger()->logException($ex);
75+
76+
OC_API::setContentType();
77+
http_response_code(500);
78+
exit();
7379
}
7480

7581
/*

0 commit comments

Comments
 (0)