Josh
4 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
10 additions and
8 deletions
-
public.php
-
remote.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]); |
|
|
|
|
|
|
|
@ -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) { |
|
|
|
|