diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-10-25 15:19:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-25 15:19:51 +0200 |
commit | 5c5cae891c4e02ab7cc04d10f6e404385bcc35d3 (patch) | |
tree | 06c5739494a094e50d9f2f1d3248cb987345a9aa | |
parent | 50cd11b583804107c98ca69e7d31472dacd0767d (diff) | |
parent | 96b8afe48570bc70088ccd8f897e9d71997d336e (diff) | |
download | nextcloud-server-5c5cae891c4e02ab7cc04d10f6e404385bcc35d3.tar.gz nextcloud-server-5c5cae891c4e02ab7cc04d10f6e404385bcc35d3.zip |
Merge pull request #26472 from owncloud/stable9.1-2064023283bc2c05147de9dccfa3914c79d99c03
[stable9.1] Merge pull request #26460 from owncloud/throw-exceptions-…
-rw-r--r-- | apps/dav/lib/Files/BrowserErrorPagePlugin.php | 17 | ||||
-rw-r--r-- | apps/dav/templates/exception.php | 14 |
2 files changed, 4 insertions, 27 deletions
diff --git a/apps/dav/lib/Files/BrowserErrorPagePlugin.php b/apps/dav/lib/Files/BrowserErrorPagePlugin.php index 5fe6f412f97..9d74ad78062 100644 --- a/apps/dav/lib/Files/BrowserErrorPagePlugin.php +++ b/apps/dav/lib/Files/BrowserErrorPagePlugin.php @@ -80,38 +80,29 @@ class BrowserErrorPagePlugin extends ServerPlugin { } $this->server->httpResponse->addHeaders($headers); $this->server->httpResponse->setStatus($httpCode); - $body = $this->generateBody($ex); + $body = $this->generateBody(); $this->server->httpResponse->setBody($body); $this->sendResponse(); } /** * @codeCoverageIgnore - * @param \Exception $ex - * @param int $httpCode * @return bool|string */ - public function generateBody(\Exception $exception) { + public function generateBody() { $request = \OC::$server->getRequest(); $content = new OC_Template('dav', 'exception', 'guest'); $content->assign('title', $this->server->httpResponse->getStatusText()); - $content->assign('message', $exception->getMessage()); - $content->assign('errorClass', get_class($exception)); - $content->assign('errorMsg', $exception->getMessage()); - $content->assign('errorCode', $exception->getCode()); - $content->assign('file', $exception->getFile()); - $content->assign('line', $exception->getLine()); - $content->assign('trace', $exception->getTraceAsString()); - $content->assign('debugMode', \OC::$server->getSystemConfig()->getValue('debug', false)); $content->assign('remoteAddr', $request->getRemoteAddress()); $content->assign('requestID', $request->getId()); return $content->fetchPage(); } - /* + /** * @codeCoverageIgnore */ public function sendResponse() { $this->server->sapi->sendResponse($this->server->httpResponse); + exit(); } } diff --git a/apps/dav/templates/exception.php b/apps/dav/templates/exception.php index 01c4eea4b5a..e01b5fda2c4 100644 --- a/apps/dav/templates/exception.php +++ b/apps/dav/templates/exception.php @@ -6,25 +6,11 @@ style('core', ['styles', 'header']); ?> <span class="error error-wide"> <h2><strong><?php p($_['title']) ?></strong></h2> - <p><?php p($_['message']) ?></p> <br> <h2><strong><?php p($l->t('Technical details')) ?></strong></h2> <ul> <li><?php p($l->t('Remote Address: %s', $_['remoteAddr'])) ?></li> <li><?php p($l->t('Request ID: %s', $_['requestID'])) ?></li> - <?php if($_['debugMode']): ?> - <li><?php p($l->t('Type: %s', $_['errorClass'])) ?></li> - <li><?php p($l->t('Code: %s', $_['errorCode'])) ?></li> - <li><?php p($l->t('Message: %s', $_['errorMsg'])) ?></li> - <li><?php p($l->t('File: %s', $_['file'])) ?></li> - <li><?php p($l->t('Line: %s', $_['line'])) ?></li> - <?php endif; ?> </ul> - - <?php if($_['debugMode']): ?> - <br /> - <h2><strong><?php p($l->t('Trace')) ?></strong></h2> - <pre><?php p($_['trace']) ?></pre> - <?php endif; ?> </span> |