|
|
|
|
@ -58,13 +58,10 @@ function handleException(Exception|Error $e): void {
|
|
|
|
|
// we shall not log on RemoteException
|
|
|
|
|
\OCP\Server::get(ITemplateManager::class)->printErrorPage($e->getMessage(), '', $e->getCode());
|
|
|
|
|
} else {
|
|
|
|
|
if ($e instanceof ServiceUnavailableException && $e->getCode() === 0) {
|
|
|
|
|
$status = 503;
|
|
|
|
|
}
|
|
|
|
|
if ($e->getCode() > 0) {
|
|
|
|
|
$status = $e->getCode();
|
|
|
|
|
} else {
|
|
|
|
|
$status = 500;
|
|
|
|
|
$status = $e instanceof ServiceUnavailableException ? 503 : 500;
|
|
|
|
|
}
|
|
|
|
|
\OCP\Server::get(LoggerInterface::class)->error($e->getMessage(), ['app' => 'remote','exception' => $e]);
|
|
|
|
|
\OCP\Server::get(ITemplateManager::class)->printExceptionErrorPage($e, $status);
|
|
|
|
|
|