aboutsummaryrefslogtreecommitdiffstats
path: root/public.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-06-26 12:15:09 +0200
committerMorris Jobke <hey@morrisjobke.de>2018-06-26 16:14:15 +0200
commitb0a296e2e1dd1b173d9cab8c82158ac6bfb86f9e (patch)
treebfcea01e9ff2d5a3cfc7580a5b1c719d68fcdd6a /public.php
parent79d9841bce94c0e9abf5e53c845236296a8999de (diff)
downloadnextcloud-server-b0a296e2e1dd1b173d9cab8c82158ac6bfb86f9e.tar.gz
nextcloud-server-b0a296e2e1dd1b173d9cab8c82158ac6bfb86f9e.zip
Do not use HTTP code OC_Response constants anymore
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'public.php')
-rw-r--r--public.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/public.php b/public.php
index 5d46f4970dc..d50f49e2536 100644
--- a/public.php
+++ b/public.php
@@ -36,7 +36,7 @@ try {
if (\OCP\Util::needUpgrade()) {
// since the behavior of apps or remotes are unpredictable during
// an upgrade, return a 503 directly
- OC_Template::printErrorPage('Service unavailable', '', OC_Response::STATUS_SERVICE_UNAVAILABLE);
+ OC_Template::printErrorPage('Service unavailable', '', 503);
exit;
}
@@ -78,10 +78,9 @@ try {
require_once OC_App::getAppPath($app) . '/' . $parts[1];
} catch (Exception $ex) {
+ $status = 500;
if ($ex instanceof \OC\ServiceUnavailableException) {
- $status = OC_Response::STATUS_SERVICE_UNAVAILABLE;
- } else {
- $status = OC_Response::STATUS_INTERNAL_SERVER_ERROR;
+ $status = 503;
}
//show the user a detailed error page
\OC::$server->getLogger()->logException($ex, ['app' => 'public']);
@@ -89,5 +88,5 @@ try {
} catch (Error $ex) {
//show the user a detailed error page
\OC::$server->getLogger()->logException($ex, ['app' => 'public']);
- OC_Template::printExceptionErrorPage($ex, OC_Response::STATUS_INTERNAL_SERVER_ERROR);
+ OC_Template::printExceptionErrorPage($ex, 500);
}