nicer exception handling
[pharext/pharext.org] / app / views / alert.phtml
index bd8c0b76b28e8fbf48c8c171607084ba6e2cc14e..5d0a51644b1bbcb6075f5d5e843556f3fb13f7e6 100644 (file)
@@ -1,6 +1,6 @@
 
 <div class="alert alert-danger" role="alert">
-       <strong><?= $this->e($exception->getMessage()) ?></strong><br>
+       <strong><?= nl2br($this->e($exception->getMessage())) ?></strong><br>
        <?php if ($exception instanceof \app\Github\Exception\TokenException) : ?>
                You might want to try to <a href="<?= $baseUrl->mod("./github/signin") ?>">renew your token</a>!
        <?php endif; ?>
@@ -8,3 +8,8 @@
                You might want to try to <a href="<?= $baseUrl->mod("./github/signin") ?>">try again</a>!
        <?php endif; ?>
 </div>
+
+<?php if (APP_ENVIRONMENT != "production") : ?>
+<h3>Stack Trace</h3>
+<pre><?= $this->e($exception->getTraceAsString()) ?></pre>
+<?php endif; ?>