From be5df5808208736e9d6e038d86b4f0a846dcb863 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Sat, 24 Jul 2010 15:56:57 -0400 Subject: [PATCH] Show the function call trace rather than just the line of the eventual error. --- framework/Core/lib/Horde.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index 075f05bb7..2e0953c1f 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -124,7 +124,13 @@ class Horde } if ($admin) { - $errortext .= '

' . sprintf(_("[line %d of %s]"), $line, $file) . '

'; + if ($error instanceof Exception) { + $trace = $error; + } else { + $trace = debug_backtrace(); + } + $backtrace = new Horde_Support_Backtrace($trace); + $errortext .= '
' . $backtrace->getMap() . '
'; if (is_object($error)) { $errortext .= '

' . _("Details:") . '

'; $errortext .= '

' . _("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.") . '

'; -- 2.11.0