diff options
author | diosmosis <benaka@piwik.pro> | 2014-10-28 06:06:08 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-10-28 06:46:32 +0300 |
commit | 5ac9a8983f6438b67bf924fc1f1ac00890a54923 (patch) | |
tree | a35c522e71bb1581ab58a819f057b35e6dddd78d /core/FrontController.php | |
parent | 4a6c3b3e3109e2d57076ad62a4bf9f8118ca2bd7 (diff) |
Remove ExitWithMessage function and documented new code.
Diffstat (limited to 'core/FrontController.php')
-rw-r--r-- | core/FrontController.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/FrontController.php b/core/FrontController.php index 7864ba6076..164cb34e74 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -599,6 +599,26 @@ class FrontController extends Singleton Piwik::postEvent('Request.dispatch.end', array(&$result, $module, $action, $parameters)); return $result; } + + /** + * Returns HTML that displays an exception's error message (and possibly stack trace). + * The result of this method is echo'd by dispatch.php. + * + * @param Exception $ex The exception to use when generating the error page's HTML. + * @return string The HTML to echo. + */ + public function getErrorResponse(Exception $ex) + { + $debugTrace = $ex->getTraceAsString(); + + if (method_exists($ex, 'getHtmlMessage')) { + $message = $ex->getHtmlMessage(); + } else { + $message = Common::sanitizeInputValue($ex->getMessage()); + } + + return Piwik_GetErrorMessagePage($message, $debugTrace, true, true); + } } /** |