mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
Merge 486b0167a4 into d09b8c99de
This commit is contained in:
commit
298d0f948f
2 changed files with 10 additions and 8 deletions
|
|
@ -89,9 +89,10 @@ try {
|
|||
$baseuri = OC::$WEBROOT . '/public.php/' . $service . '/';
|
||||
require_once $file;
|
||||
} catch (Exception $ex) {
|
||||
$status = 500;
|
||||
if ($ex instanceof ServiceUnavailableException) {
|
||||
$status = 503;
|
||||
if ($ex->getCode() > 0) {
|
||||
$status = $ex->getCode();
|
||||
} else {
|
||||
$status = $ex instanceof ServiceUnavailableException ? 503 : 500;
|
||||
}
|
||||
//show the user a detailed error page
|
||||
Server::get(LoggerInterface::class)->error($ex->getMessage(), ['app' => 'public', 'exception' => $ex]);
|
||||
|
|
|
|||
11
remote.php
11
remote.php
|
|
@ -54,16 +54,17 @@ function handleException(Exception|Error $e): void {
|
|||
});
|
||||
$server->exec();
|
||||
} else {
|
||||
$statusCode = 500;
|
||||
if ($e instanceof ServiceUnavailableException) {
|
||||
$statusCode = 503;
|
||||
}
|
||||
if ($e instanceof RemoteException) {
|
||||
// we shall not log on RemoteException
|
||||
\OCP\Server::get(ITemplateManager::class)->printErrorPage($e->getMessage(), '', $e->getCode());
|
||||
} else {
|
||||
if ($e->getCode() > 0) {
|
||||
$status = $e->getCode();
|
||||
} else {
|
||||
$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, $statusCode);
|
||||
\OCP\Server::get(ITemplateManager::class)->printExceptionErrorPage($e, $status);
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue