Compare commits

...

2 Commits

Author SHA1 Message Date
Ferdinand Thiessen 486b0167a4
chore: simplify if condition
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-12-10 15:35:29 +07:00
Ferdinand Thiessen d24cedfadd
chore: simplify if condition
Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-12-10 15:33:49 +07:00
2 changed files with 2 additions and 8 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]);

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