error500.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * @var \App\View\AppView $this
  4. * @var \Cake\Database\StatementInterface $error
  5. * @var string $message
  6. * @var string $url
  7. */
  8. use Cake\Core\Configure;
  9. use Cake\Error\Debugger;
  10. $this->layout = 'error';
  11. if (Configure::read('debug')) :
  12. $this->layout = 'dev_error';
  13. $this->assign('title', $message);
  14. $this->assign('templateName', 'error500.php');
  15. $this->start('file');
  16. ?>
  17. <?php if (!empty($error->queryString)) : ?>
  18. <p class="notice">
  19. <strong>SQL Query: </strong>
  20. <?= h($error->queryString) ?>
  21. </p>
  22. <?php endif; ?>
  23. <?php if (!empty($error->params)) : ?>
  24. <strong>SQL Query Params: </strong>
  25. <?php Debugger::dump($error->params) ?>
  26. <?php endif; ?>
  27. <?php if ($error instanceof Error) : ?>
  28. <?php $file = $error->getFile() ?>
  29. <?php $line = $error->getLine() ?>
  30. <strong>Error in: </strong>
  31. <?= $this->Html->link(sprintf('%s, line %s', Debugger::trimPath($file), $line), Debugger::editorUrl($file, $line)); ?>
  32. <?php endif; ?>
  33. <?php
  34. echo $this->element('auto_table_warning');
  35. $this->end();
  36. endif;
  37. ?>
  38. <h2><?= __d('cake', 'An Internal Error Has Occurred.') ?></h2>
  39. <p class="error">
  40. <strong><?= __d('cake', 'Error') ?>: </strong>
  41. <?= h($message) ?>
  42. </p>