]> source.dussan.org Git - nextcloud-server.git/commitdiff
handle service not available exceptions in index, remote and public.php
authorRobin Appelman <icewind@owncloud.com>
Thu, 24 Jul 2014 15:18:10 +0000 (17:18 +0200)
committerRobin Appelman <icewind@owncloud.com>
Mon, 4 Aug 2014 11:41:04 +0000 (13:41 +0200)
index.php
public.php
remote.php

index bd94d0e908d641123a814246ffa59ccbc69cffd1..061391892feea33fbc870be72aeb018d7444a8b1 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -27,6 +27,12 @@ try {
 
        OC::handleRequest();
 
+} catch(\OC\ServiceUnavailableException $ex) {
+       \OCP\Util::logException('index', $ex);
+
+       //show the user a detailed error page
+       OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
+       OC_Template::printExceptionErrorPage($ex);
 } catch (Exception $ex) {
        \OCP\Util::logException('index', $ex);
 
index 2ac082dba5709540fe4f857519d056f927612a36..0e04db66da79c6ada33e45b12f58363afb3e3082 100644 (file)
@@ -45,6 +45,11 @@ try {
 
        require_once OC_App::getAppPath($app) . '/' . $parts[1];
 
+} catch (\OC\ServiceUnavailableException $ex) {
+       //show the user a detailed error page
+       OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
+       \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL);
+       OC_Template::printExceptionErrorPage($ex);
 } catch (Exception $ex) {
        //show the user a detailed error page
        OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
index a91742b0475547c7ed15002fd901c97cf87fd616..d854b1d65a6ab8c33a1b261fa6e8096f98dff363 100644 (file)
@@ -51,6 +51,10 @@ try {
        $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
        require_once $file;
 
+} catch (\OC\ServiceUnavailableException $ex) {
+       OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
+       \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL);
+       OC_Template::printExceptionErrorPage($ex);
 } catch (Exception $ex) {
        OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
        \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL);