Show the function call trace rather than just the line of the eventual error.
authorChuck Hagenbuch <chuck@horde.org>
Sat, 24 Jul 2010 19:56:57 +0000 (15:56 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Sat, 24 Jul 2010 19:56:57 +0000 (15:56 -0400)
framework/Core/lib/Horde.php

index 075f05b..2e0953c 100644 (file)
@@ -124,7 +124,13 @@ class Horde
         }
 
         if ($admin) {
-            $errortext .= '<p><code>' . sprintf(_("[line %d of %s]"), $line, $file) . '</code></p>';
+            if ($error instanceof Exception) {
+                $trace = $error;
+            } else {
+                $trace = debug_backtrace();
+            }
+            $backtrace = new Horde_Support_Backtrace($trace);
+            $errortext .= '<div id="backtrace"><pre>' . $backtrace->getMap() . '</pre></div>';
             if (is_object($error)) {
                 $errortext .= '<h3>' . _("Details:") . '</h3>';
                 $errortext .= '<h4>' . _("The full error message is logged in Horde's log file, and is shown below only to administrators. Non-administrative users will not see error details.") . '</h4>';