diff --git a/gulliver/system/class.controller.php b/gulliver/system/class.controller.php index b0dd1ec06..703d5e252 100644 --- a/gulliver/system/class.controller.php +++ b/gulliver/system/class.controller.php @@ -21,6 +21,8 @@ class Controller private $headPublisher; public $ExtVar = Array(); + + public $controllerClass = ''; public function __construct() { @@ -97,7 +99,15 @@ class Controller $this->$name($this->__request__); } catch (Exception $e) { - new PMException($e->getMessage(), 1); + $template = new TemplatePower(PATH_TEMPLATE . 'controller.exception.tpl'); + $template->prepare(); + $template->assign('controller', get_called_class()); + $template->assign('message', $e->getMessage()); + $template->assign('file', $e->getFile()); + $template->assign('line', $e->getLine()); + $template->assign('trace', $e->getTraceAsString()); + + echo $template->getOutputContent(); } } diff --git a/gulliver/system/class.httpProxyController.php b/gulliver/system/class.httpProxyController.php index 2dddcbff9..a3f6f9757 100755 --- a/gulliver/system/class.httpProxyController.php +++ b/gulliver/system/class.httpProxyController.php @@ -97,6 +97,7 @@ class HttpProxyController { $result->exception->class = get_class($e); $result->exception->code = $e->getCode(); + $result->exception->trace = $e->getTraceAsString(); } print G::json_encode($result); } diff --git a/gulliver/templates/controller.exception.tpl b/gulliver/templates/controller.exception.tpl new file mode 100644 index 000000000..204cf3544 --- /dev/null +++ b/gulliver/templates/controller.exception.tpl @@ -0,0 +1,58 @@ + + +
+ +|
+ CONTROLLER EXCEPTION + + {message} + Controller: {controller} + File: {file} + Line: {line} + + + +
|
+