瀏覽代碼

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

tags/v8.0.0alpha1
Robin Appelman 10 年之前
父節點
當前提交
a05147e25c
共有 3 個檔案被更改,包括 15 行新增0 行删除
  1. 6
    0
      index.php
  2. 5
    0
      public.php
  3. 4
    0
      remote.php

+ 6
- 0
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);


+ 5
- 0
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);

+ 4
- 0
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);

Loading…
取消
儲存