Adding stack trace output to the framework errors.

This commit is contained in:
Mark Story 2010-09-06 17:54:48 -04:00
parent 01eb0bf07d
commit 09fd8ba463
17 changed files with 47 additions and 15 deletions

View file

@ -40,7 +40,9 @@ class CakeErrorController extends AppController {
function beforeRender() { function beforeRender() {
parent::beforeRender(); parent::beforeRender();
foreach ($this->viewVars as $key => $value) { foreach ($this->viewVars as $key => $value) {
if (!is_object($value)){
$this->viewVars[$key] = h($value); $this->viewVars[$key] = h($value);
} }
} }
} }
}

View file

@ -200,7 +200,8 @@ class ErrorHandler {
$this->controller->set(array( $this->controller->set(array(
'code' => $code, 'code' => $code,
'url' => h($url), 'url' => h($url),
'name' => $error->getMessage() 'name' => $error->getMessage(),
'error' => $error,
)); ));
$this->controller->set($error->getAttributes()); $this->controller->set($error->getAttributes());
$this->_outputMessage($this->template); $this->_outputMessage($this->template);

View file

@ -42,3 +42,4 @@ class <?php echo $controller;?> extends AppController {
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s.'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_action.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s.'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_action.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -37,3 +37,5 @@ class <?php echo $class;?> extends ModelBehavior {
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_class.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_class.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -37,3 +37,5 @@ class <?php echo $class;?> extends ModelBehavior {
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_file.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_file.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -37,3 +37,5 @@ class <?php echo $class;?> extends Component {<br />
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_class.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_class.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -37,3 +37,5 @@ class <?php echo $class;?> extends Component {<br />
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_file.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_file.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -30,3 +30,5 @@
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s.'), APP_DIR . DS . 'views' . DS . 'errors' . DS . basename(__FILE__)); ?> <?php printf(__('If you want to customize this error message, create %s.'), APP_DIR . DS . 'views' . DS . 'errors' . DS . basename(__FILE__)); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -37,3 +37,5 @@ class <?php echo $controller;?> extends AppController {
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_controller.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_controller.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -30,3 +30,5 @@
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_scaffolddb.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_scaffolddb.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -37,3 +37,5 @@ class <?php echo $class;?> extends AppHelper {
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_class.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_class.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -37,3 +37,5 @@ class <?php echo $class;?> extends AppHelper {
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_file.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_file.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -30,3 +30,5 @@
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_layout.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_layout.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -26,3 +26,5 @@
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_table.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_table.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -30,3 +30,5 @@
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_view.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_view.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -26,3 +26,5 @@
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'private_action.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'private_action.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -33,3 +33,5 @@ function _scaffoldError() {<br />
} }
?&gt; ?&gt;
</pre> </pre>
<?php echo $this->element('exception_stack_trace'); ?>