Skip to content

Commit

Permalink
Merge pull request #953 from andrii-pukhalevych/patch1
Browse files Browse the repository at this point in the history
Use Debugger::trimPath() and Debugger::editorUrl() for error templates
  • Loading branch information
markstory authored Jun 26, 2023
2 parents 61d9e1c + 8ec4404 commit 2489b04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions templates/Error/error400.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
</p>
<?php endif; ?>
<?php if (!empty($error->params)) : ?>
<strong>SQL Query Params: </strong>
<?php Debugger::dump($error->params) ?>
<strong>SQL Query Params: </strong>
<?php Debugger::dump($error->params) ?>
<?php endif; ?>
<?= $this->element('auto_table_warning') ?>

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

$this->end();
$this->end();
endif;
?>
<h2><?= h($message) ?></h2>
Expand Down
4 changes: 3 additions & 1 deletion templates/Error/error500.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
<?php Debugger::dump($error->params) ?>
<?php endif; ?>
<?php if ($error instanceof Error) : ?>
<?php $file = $error->getFile() ?>
<?php $line = $error->getLine() ?>
<strong>Error in: </strong>
<?= sprintf('%s, line %s', str_replace(ROOT, 'ROOT', $error->getFile()), $error->getLine()) ?>
<?= $this->Html->link(sprintf('%s, line %s', Debugger::trimPath($file), $line), Debugger::editorUrl($file, $line)); ?>
<?php endif; ?>
<?php
echo $this->element('auto_table_warning');
Expand Down

0 comments on commit 2489b04

Please sign in to comment.