chore: simplify if condition

Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/56170/head
Ferdinand Thiessen 2025-12-10 15:33:49 +07:00 committed by GitHub
parent 55c20fe9d9
commit d24cedfadd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 4 deletions

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