previousException.php 1.0 KB

123456789101112131415161718192021222324
  1. <?php
  2. /* @var $exception \yii\base\Exception */
  3. /* @var $handler \yii\web\ErrorHandler */
  4. ?>
  5. <div class="previous">
  6. <span class="arrow">&crarr;</span>
  7. <h2>
  8. <span>Caused by:</span>
  9. <?php $name = $handler->getExceptionName($exception) ?>
  10. <?php if ($name !== null): ?>
  11. <span><?= $handler->htmlEncode($name) ?></span> &ndash;
  12. <?= $handler->addTypeLinks(get_class($exception)) ?>
  13. <?php else: ?>
  14. <span><?= $handler->htmlEncode(get_class($exception)) ?></span>
  15. <?php endif; ?>
  16. </h2>
  17. <h3><?= nl2br($handler->htmlEncode($exception->getMessage())) ?></h3>
  18. <p>in <span class="file"><?= $exception->getFile() ?></span> at line <span class="line"><?= $exception->getLine() ?></span></p>
  19. <?php if ($exception instanceof \yii\db\Exception && !empty($exception->errorInfo)): ?>
  20. <pre>Error Info: <?= $handler->htmlEncode(print_r($exception->errorInfo, true)) ?></pre>
  21. <?php endif ?>
  22. <?= $handler->renderPreviousExceptions($exception) ?>
  23. </div>