Skip to content

Commit

Permalink
Update pdo_error.ctp
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 6, 2014
1 parent 9a635f6 commit 05463ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/Template/Error/pdo_error.ctp
Expand Up @@ -13,29 +13,32 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use Cake\Error\Debugger;

$this->layout = 'dev_error';

$this->assign('title', 'Database Error');
$this->assign('templateName', 'pdo_error.ctp');

$this->start('subheading');
?>
<h2>Database Error</h2>
<p class="error">
<strong>Error: </strong>
<?= $message; ?>
</p>
<?php $this->end() ?>

<?php $this->start('file') ?>
<p class="notice">
If you are using SQL keywords as table column names, you can enable identifier
quoting for your database connection in config/app.php.
</p>
<?php if (!empty($error->queryString)) : ?>
<p class="notice">
<strong>SQL Query: </strong>
<?= h($error->queryString); ?>
</p>
<pre><?= h($error->queryString); ?></pre>
<?php endif; ?>
<?php if (!empty($error->params)) : ?>
<strong>SQL Query Params: </strong>
<?= Debugger::dump($error->params); ?>
<pre><?= Debugger::dump($error->params); ?></pre>
<?php endif; ?>
<?= $this->element('auto_table_warning'); ?>
<p class="notice">
<strong>Notice: </strong>
<?= sprintf('If you want to customize this error message, create %s', APP_DIR . DS . 'Template' . DS . 'Error' . DS . 'pdo_error.ctp'); ?>
</p>
<?= $this->element('exception_stack_trace'); ?>
<?php $this->end() ?>
1 change: 1 addition & 0 deletions src/Template/Layout/dev_error.ctp
Expand Up @@ -133,6 +133,7 @@ pre {
background: #fefefe;
border: 1px solid #ddd;
padding: 5px;
white-space: pre-wrap;
}

header {
Expand Down

0 comments on commit 05463ad

Please sign in to comment.