[Pkg-owncloud-commits] [owncloud] 97/121: handle service not available exceptions in index, remote and public.php

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 16:44:39 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 22387b83460e508171a758638fb704e99dff3a4a
Author: Robin Appelman <icewind at owncloud.com>
Date:   Thu Jul 24 17:18:10 2014 +0200

    handle service not available exceptions in index, remote and public.php
---
 index.php  | 6 ++++++
 public.php | 5 +++++
 remote.php | 4 ++++
 3 files changed, 15 insertions(+)

diff --git a/index.php b/index.php
index bd94d0e..0613918 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 2ac082d..0e04db6 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 a91742b..d854b1d 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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list