From 1399f6bece1ff44c062acb21bf880c9d6eb8695e Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 26 Jun 2018 10:27:43 +0200 Subject: Server exception error pages by default with a 500 status code Signed-off-by: Morris Jobke --- index.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 75511de12e1..b66281e6449 100644 --- a/index.php +++ b/index.php @@ -45,8 +45,7 @@ try { \OC::$server->getLogger()->logException($ex, array('app' => 'index')); //show the user a detailed error page - OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); - OC_Template::printExceptionErrorPage($ex); + OC_Template::printExceptionErrorPage($ex, \OC_Response::STATUS_SERVICE_UNAVAILABLE); } catch (\OC\HintException $ex) { try { OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), OC_Response::STATUS_SERVICE_UNAVAILABLE); @@ -55,8 +54,7 @@ try { \OC::$server->getLogger()->logException($ex2, array('app' => 'index')); //show the user a detailed error page - OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); - OC_Template::printExceptionErrorPage($ex); + OC_Template::printExceptionErrorPage($ex, \OC_Response::STATUS_INTERNAL_SERVER_ERROR); } } catch (\OC\User\LoginException $ex) { OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), OC_Response::STATUS_FORBIDDEN); @@ -90,6 +88,5 @@ try { throw $e; } - OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); - OC_Template::printExceptionErrorPage($ex); + OC_Template::printExceptionErrorPage($ex, \OC_Response::STATUS_INTERNAL_SERVER_ERROR); } -- cgit v1.2.3