diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-07-24 17:18:10 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-08-04 13:41:04 +0200 |
commit | a05147e25c87e320b9dd3d95d244109d88057e62 (patch) | |
tree | 7ea4c45e39312e4e565c0c6d454720fea30de57a | |
parent | 4608f8a3b5f3f88ce033817f682103c31f8a934f (diff) | |
download | nextcloud-server-a05147e25c87e320b9dd3d95d244109d88057e62.tar.gz nextcloud-server-a05147e25c87e320b9dd3d95d244109d88057e62.zip |
handle service not available exceptions in index, remote and public.php
-rwxr-xr-x | index.php | 6 | ||||
-rw-r--r-- | public.php | 5 | ||||
-rw-r--r-- | remote.php | 4 |
3 files changed, 15 insertions, 0 deletions
diff --git a/index.php b/index.php index bd94d0e908d..061391892fe 100755 --- 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); diff --git a/public.php b/public.php index 2ac082dba57..0e04db66da7 100644 --- a/public.php +++ b/public.php @@ -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); diff --git a/remote.php b/remote.php index a91742b0475..d854b1d65a6 100644 --- a/remote.php +++ b/remote.php @@ -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); |