Josh 4 days ago
committed by GitHub
parent
commit
ea9ae71dc9
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      public.php
  2. 11
      remote.php

7
public.php

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

@ -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…
Cancel
Save