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() {
parent::beforeRender();
foreach ($this->viewVars as $key => $value) {
$this->viewVars[$key] = h($value);
if (!is_object($value)){
$this->viewVars[$key] = h($value);
}
}
}
}

View file

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

View file

@ -41,4 +41,5 @@ class <?php echo $controller;?> extends AppController {
<p class="notice">
<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'); ?>
</p>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -36,4 +36,6 @@ class <?php echo $class;?> extends ModelBehavior {
<p class="notice">
<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'); ?>
</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>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_file.ctp'); ?>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -36,4 +36,6 @@ class <?php echo $class;?> extends Component {<br />
<p class="notice">
<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'); ?>
</p>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -36,4 +36,6 @@ class <?php echo $class;?> extends Component {<br />
<p class="notice">
<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'); ?>
</p>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -29,4 +29,6 @@
<p class="notice">
<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__)); ?>
</p>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -36,4 +36,6 @@ class <?php echo $controller;?> extends AppController {
<p class="notice">
<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'); ?>
</p>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -29,4 +29,6 @@
<p class="notice">
<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'); ?>
</p>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -36,4 +36,6 @@ class <?php echo $class;?> extends AppHelper {
<p class="notice">
<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'); ?>
</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>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_file.ctp'); ?>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -29,4 +29,6 @@
<p class="notice">
<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'); ?>
</p>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -25,4 +25,6 @@
<p class="notice">
<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'); ?>
</p>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -29,4 +29,6 @@
<p class="notice">
<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'); ?>
</p>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -25,4 +25,6 @@
<p class="notice">
<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'); ?>
</p>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

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