Browse Source

handle service not available exceptions in index, remote and public.php

tags/v8.0.0alpha1
Robin Appelman 9 years ago
parent
commit
a05147e25c
3 changed files with 15 additions and 0 deletions
  1. 6
    0
      index.php
  2. 5
    0
      public.php
  3. 4
    0
      remote.php

+ 6
- 0
index.php View File

@@ -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);


+ 5
- 0
public.php View 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);

+ 4
- 0
remote.php View 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);

Loading…
Cancel
Save