diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-24 16:29:55 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-24 21:02:16 +0300 |
commit | c46f480031856408eed09ee638da10fa495c7dad (patch) | |
tree | aa21a6e87bdd40ee9d851f8256f82261726254ea /lib/private/template.php | |
parent | a7e7f5e18098ff0f536e58a7e1e5dfdc825e9086 (diff) |
In case of exception we return an html page in case the client is a browser
Diffstat (limited to 'lib/private/template.php')
-rw-r--r-- | lib/private/template.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/template.php b/lib/private/template.php index bc706e29344..2653ae6086a 100644 --- a/lib/private/template.php +++ b/lib/private/template.php @@ -333,7 +333,7 @@ class OC_Template extends \OC\Template\Base { * print error page using Exception details * @param Exception $exception */ - public static function printExceptionErrorPage($exception) { + public static function printExceptionErrorPage($exception, $fetchPage = false) { try { $request = \OC::$server->getRequest(); $content = new \OC_Template('', 'exception', 'error', false); @@ -346,6 +346,9 @@ class OC_Template extends \OC\Template\Base { $content->assign('debugMode', \OC::$server->getSystemConfig()->getValue('debug', false)); $content->assign('remoteAddr', $request->getRemoteAddress()); $content->assign('requestID', $request->getId()); + if ($fetchPage) { + return $content->fetchPage(); + } $content->printPage(); } catch (\Exception $e) { $logger = \OC::$server->getLogger(); |