diff --git a/remote.php b/remote.php index 656ec7458fa..27fb703c87c 100644 --- a/remote.php +++ b/remote.php @@ -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);