diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-07-08 19:00:31 -0700 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-07-08 19:00:31 -0700 |
commit | 30084ede70b1f17b620f5bb5d38ccabb3321f5df (patch) | |
tree | e55efb88fa4db408220e73d0279702ed35af7403 /Bugzilla/Error.pm | |
parent | Bug 577588: xt/seach.t was sometimes not properly translating special (diff) | |
download | bugzilla-30084ede70b1f17b620f5bb5d38ccabb3321f5df.tar.gz bugzilla-30084ede70b1f17b620f5bb5d38ccabb3321f5df.tar.bz2 bugzilla-30084ede70b1f17b620f5bb5d38ccabb3321f5df.zip |
Bug 576670: Optimize Search.pm's "init" method for being called many times
in a loop
r=glob, a=mkanat
Diffstat (limited to 'Bugzilla/Error.pm')
-rw-r--r-- | Bugzilla/Error.pm | 16 |
1 files changed, 10 insertions, 6 deletions
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", @_); } |