aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-08 19:00:31 -0700
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-08 19:00:31 -0700
commit30084ede70b1f17b620f5bb5d38ccabb3321f5df (patch)
treee55efb88fa4db408220e73d0279702ed35af7403 /Bugzilla/Error.pm
parentBug 577588: xt/seach.t was sometimes not properly translating special (diff)
downloadbugzilla-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.pm16
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", @_);
}