mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
chore: simplify if condition
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
d24cedfadd
commit
486b0167a4
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue