Skip to content

Commit a287169

Browse files
committed
chore: simplify if condition
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 94fa9aa commit a287169

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

remote.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,10 @@ function handleException(Exception|Error $e): void {
5858
// we shall not log on RemoteException
5959
\OCP\Server::get(ITemplateManager::class)->printErrorPage($e->getMessage(), '', $e->getCode());
6060
} else {
61-
if ($e instanceof ServiceUnavailableException && $e->getCode() === 0) {
62-
$status = 503;
63-
}
6461
if ($e->getCode() > 0) {
6562
$status = $e->getCode();
6663
} else {
67-
$status = 500;
64+
$status = $e instanceof ServiceUnavailableException ? 503 : 500;
6865
}
6966
\OCP\Server::get(LoggerInterface::class)->error($e->getMessage(), ['app' => 'remote','exception' => $e]);
7067
\OCP\Server::get(ITemplateManager::class)->printExceptionErrorPage($e, $status);

0 commit comments

Comments
 (0)