From 6a6fc742dc736875a9d0a2be6891ba0fc635f1dc Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Wed, 20 Apr 2016 18:01:47 +0200 Subject: Catch class Error on all root entrypoints --- index.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index f3bf699f3c1..2acf81ab6d7 100644 --- a/index.php +++ b/index.php @@ -39,7 +39,7 @@ try { OC::handleRequest(); } catch(\OC\ServiceUnavailableException $ex) { - \OCP\Util::logException('index', $ex); + \OC::$server->getLogger()->logException($ex, ['app' => 'index']); //show the user a detailed error page OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); @@ -48,9 +48,13 @@ try { OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); OC_Template::printErrorPage($ex->getMessage(), $ex->getHint()); } catch (Exception $ex) { - \OCP\Util::logException('index', $ex); + \OC::$server->getLogger()->logException($ex, ['app' => 'index']); //show the user a detailed error page OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); OC_Template::printExceptionErrorPage($ex); +} catch (Error $ex) { + \OC::$server->getLogger()->logException($ex, ['app' => 'index']); + OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); + OC_Template::printExceptionErrorPage($ex); } -- cgit v1.2.3