Better overview on previous exceptions and more exception details (file name, line...
authorMarco Pivetta <ocramius@gmail.com>
Wed, 29 Feb 2012 22:33:06 +0000 (23:33 +0100)
committerMarco Pivetta <ocramius@gmail.com>
Wed, 29 Feb 2012 22:33:06 +0000 (23:33 +0100)
module/Application/view/error/index.phtml

index e62262f..ab9bf9b 100644 (file)
@@ -4,14 +4,54 @@
 <?php if (isset($this->display_exceptions) && $this->display_exceptions): ?>
 
 <?php if(isset($this->exception) && $this->exception instanceof Exception): ?>
-
-<h3>Exception information:</h3>
-<p>
-    <h4>Message:</h4>
-    <pre><?php echo $this->exception->getMessage() ?></pre>
-    <h4>Stack trace:</h4>
-    <pre><?php echo $this->exception->getTraceAsString() ?></pre>
-</p>
+<hr/>
+<h2>Additional information:</h2>
+<h3><?php echo get_class($this->exception); ?></h3>
+<dl>
+    <dt>File:</dt>
+    <dd>
+        <pre class="prettyprint linenums"><?php echo $this->exception->getFile() ?>:<?php echo $this->exception->getLine() ?></pre>
+    </dd>
+    <dt>Message:</dt>
+    <dd>
+        <pre class="prettyprint linenums"><?php echo $this->exception->getMessage() ?></pre>
+    </dd>
+    <dt>Stack trace:</dt>
+    <dd>
+        <pre class="prettyprint linenums"><?php echo $this->exception->getTraceAsString() ?></pre>
+    </dd>
+</dl>
+<?php
+    $e = $this->exception->getPrevious();
+    if ($e) :
+?>
+<hr/>
+<h2>Previous exceptions:</h2>
+<ul class="unstyled">
+    <?php while($e) : ?>
+    <li>
+        <h3><?php echo get_class($e); ?></h3>
+        <dl>
+            <dt>File:</dt>
+            <dd>
+                <pre class="prettyprint linenums"><?php echo $e->getFile() ?>:<?php echo $e->getLine() ?></pre>
+            </dd>
+            <dt>Message:</dt>
+            <dd>
+                <pre class="prettyprint linenums"><?php echo $e->getMessage() ?></pre>
+            </dd>
+            <dt>Stack trace:</dt>
+            <dd>
+                <pre class="prettyprint linenums"><?php echo $e->getTraceAsString() ?></pre>
+            </dd>
+        </dl>
+        <?php
+                $e = $e->getPrevious();
+            endwhile;
+        ?>
+    </li>
+</ul>
+<?php endif; ?>
 
 <?php else: ?>
 
@@ -19,4 +59,4 @@
 
 <?php endif ?>
 
-<?php endif ?>
\ No newline at end of file
+<?php endif ?>