From d24cedfadd063bc7cb1c61be93346b5f5876a2ac Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 10 Dec 2025 15:33:49 +0100 Subject: [PATCH] chore: simplify if condition Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Ferdinand Thiessen --- public.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/public.php b/public.php index b374d7cb71a..fce195ba00e 100644 --- a/public.php +++ b/public.php @@ -89,13 +89,10 @@ try { $baseuri = OC::$WEBROOT . '/public.php/' . $service . '/'; require_once $file; } catch (Exception $ex) { - if ($ex instanceof ServiceUnavailableException && $ex->getCode() === 0) { - $status = 503; - } if ($ex->getCode() > 0) { $status = $ex->getCode(); } else { - $status = 500; + $status = $ex instanceof ServiceUnavailableException ? 503 : 500; } //show the user a detailed error page Server::get(LoggerInterface::class)->error($ex->getMessage(), ['app' => 'public', 'exception' => $ex]);