Skip to content

Commit

Permalink
Adding stack trace output to the framework errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 6, 2010
1 parent 01eb0bf commit 09fd8ba
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 15 deletions.
4 changes: 3 additions & 1 deletion cake/libs/controller/cake_error_controller.php
Expand Up @@ -40,7 +40,9 @@ function __construct() {
function beforeRender() {
parent::beforeRender();
foreach ($this->viewVars as $key => $value) {
$this->viewVars[$key] = h($value);
if (!is_object($value)){
$this->viewVars[$key] = h($value);
}
}
}
}
3 changes: 2 additions & 1 deletion cake/libs/error_handler.php
Expand Up @@ -200,7 +200,8 @@ protected function _cakeError(CakeException $error) {
$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);
Expand Down
3 changes: 2 additions & 1 deletion cake/libs/view/errors/missing_action.ctp
Expand Up @@ -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'); ?>
4 changes: 3 additions & 1 deletion cake/libs/view/errors/missing_behavior_class.ctp
Expand Up @@ -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'); ?>
2 changes: 2 additions & 0 deletions cake/libs/view/errors/missing_behavior_file.ctp
Expand Up @@ -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'); ?>
4 changes: 3 additions & 1 deletion cake/libs/view/errors/missing_component_class.ctp
Expand Up @@ -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'); ?>
4 changes: 3 additions & 1 deletion cake/libs/view/errors/missing_component_file.ctp
Expand Up @@ -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'); ?>
4 changes: 3 additions & 1 deletion cake/libs/view/errors/missing_connection.ctp
Expand Up @@ -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'); ?>
4 changes: 3 additions & 1 deletion cake/libs/view/errors/missing_controller.ctp
Expand Up @@ -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'); ?>
4 changes: 3 additions & 1 deletion cake/libs/view/errors/missing_database.ctp
Expand Up @@ -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'); ?>
4 changes: 3 additions & 1 deletion cake/libs/view/errors/missing_helper_class.ctp
Expand Up @@ -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'); ?>
2 changes: 2 additions & 0 deletions cake/libs/view/errors/missing_helper_file.ctp
Expand Up @@ -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'); ?>
4 changes: 3 additions & 1 deletion cake/libs/view/errors/missing_layout.ctp
Expand Up @@ -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'); ?>
4 changes: 3 additions & 1 deletion cake/libs/view/errors/missing_table.ctp
Expand Up @@ -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'); ?>
4 changes: 3 additions & 1 deletion cake/libs/view/errors/missing_view.ctp
Expand Up @@ -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'); ?>
4 changes: 3 additions & 1 deletion cake/libs/view/errors/private_action.ctp
Expand Up @@ -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'); ?>
4 changes: 3 additions & 1 deletion cake/libs/view/errors/scaffold_error.ctp
Expand Up @@ -32,4 +32,6 @@ function _scaffoldError() {<br />

}
?&gt;
</pre>
</pre>

<?php echo $this->element('exception_stack_trace'); ?>

0 comments on commit 09fd8ba

Please sign in to comment.