From 30084ede70b1f17b620f5bb5d38ccabb3321f5df Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Thu, 8 Jul 2010 19:00:31 -0700 Subject: Bug 576670: Optimize Search.pm's "init" method for being called many times in a loop r=glob, a=mkanat --- Bugzilla/Error.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Bugzilla/Error.pm') diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm index 649fdd486..395cc0dc9 100644 --- a/Bugzilla/Error.pm +++ b/Bugzilla/Error.pm @@ -53,12 +53,6 @@ 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 @@ -159,6 +153,16 @@ sub ThrowUserError { } sub ThrowCodeError { + my (undef, $vars) = @_; + + # 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(); + _throw_error("global/code-error.html.tmpl", @_); } -- cgit v1.2.3-24-g4f1b