]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 372537: Improve CodeErrors: show the traceback (without function
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Fri, 14 May 2010 14:11:38 +0000 (07:11 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Fri, 14 May 2010 14:11:38 +0000 (07:11 -0700)
arguments)
r=LpSolit, a=LpSolit

Bugzilla/Error.pm
template/en/default/global/code-error.html.tmpl

index 0c471125dde82b502d3c5c87d36260a3f5947d87..60e7837deb50bf68034152a91cc8f7f7583745f5 100644 (file)
@@ -31,6 +31,8 @@ use base qw(Exporter);
 use Bugzilla::Constants;
 use Bugzilla::WebService::Constants;
 use Bugzilla::Util;
+
+use Carp;
 use Date::Format;
 
 # We cannot use $^S to detect if we are in an eval(), because mod_perl
@@ -50,6 +52,12 @@ sub _throw_error {
     $vars ||= {};
 
     $vars->{error} = $error;
+    # Don't show function arguments, in case they contain confidential data.
+    local $Carp::MaxArgNums = -1;
+    # Don't show the error as coming from Bugzilla::Error, show it as coming
+    # from the caller.
+    local $Carp::CarpInternal{'Bugzilla::Error'} = 1; 
+    $vars->{traceback} = Carp::longmess();
 
     # Make sure any transaction is rolled back (if supported).
     # If we are within an eval(), do not roll back transactions as we are
index c91bc66eeb3fb873dae6cdd6c5d4a6cb8dc53fc3..e3bd3ba8b0c9916a07086eeee12c8391e368e390 100644 (file)
   </tr>
 </table>
 
+<p>Traceback:</p>
+<pre>[% traceback FILTER html_linebreak %]</pre>
+
 [% IF variables %]
   <pre>
 Variables: