mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
fix(public.php): Actually pass specified HTTP code for exceptions
Signed-off-by: Josh <josh.t.richards@gmail.com>
This commit is contained in:
parent
12e80195d7
commit
d8f465b52d
1 changed files with 6 additions and 2 deletions
|
|
@ -89,10 +89,14 @@ try {
|
|||
$baseuri = OC::$WEBROOT . '/public.php/' . $service . '/';
|
||||
require_once $file;
|
||||
} catch (Exception $ex) {
|
||||
$status = 500;
|
||||
if ($ex instanceof ServiceUnavailableException) {
|
||||
if ($ex instanceof ServiceUnavailableException && $ex->getCode === 0) {
|
||||
$status = 503;
|
||||
}
|
||||
if ($ex->getCode() > 0) {
|
||||
$status = $ex->getCode();
|
||||
} else {
|
||||
$status = 500;
|
||||
}
|
||||
//show the user a detailed error page
|
||||
Server::get(LoggerInterface::class)->error($ex->getMessage(), ['app' => 'public', 'exception' => $ex]);
|
||||
Server::get(ITemplateManager::class)->printExceptionErrorPage($ex, $status);
|
||||
|
|
|
|||
Loading…
Reference in a new issue