return proper error code when reporting exception fails in remote.php

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2022-10-05 12:39:00 +02:00
parent 7d024bc337
commit 4dbcfa387a
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with 37 additions and 33 deletions

View File

@ -50,6 +50,7 @@ class RemoteException extends Exception {
* @param Exception|Error $e
*/
function handleException($e) {
try {
$request = \OC::$server->getRequest();
// in case the request content type is text/xml - we assume it's a WebDAV request
$isXmlContentType = strpos($request->getHeader('Content-Type'), 'text/xml');
@ -87,6 +88,9 @@ function handleException($e) {
OC_Template::printExceptionErrorPage($e, $statusCode);
}
}
} catch (\Exception $e) {
OC_Template::printExceptionErrorPage($e, 500);
}
}
/**