chore: simplify if condition

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/56170/head
Ferdinand Thiessen 2025-12-10 15:35:29 +07:00 committed by GitHub
parent d24cedfadd
commit 486b0167a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 4 deletions

@ -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);