summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-06-13 07:08:01 +0200
committerByron Jones <bjones@mozilla.com>2012-06-13 07:08:01 +0200
commit01076cee38eb2a5b806e62e62c945cd2c71bfae1 (patch)
tree9473183e0d740ab7bb772fb8c2a92b99ce9333db
parent757ba9e487fb8f737fee2acffe6ef38645c83715 (diff)
downloadbugzilla-01076cee38eb2a5b806e62e62c945cd2c71bfae1.tar.gz
bugzilla-01076cee38eb2a5b806e62e62c945cd2c71bfae1.tar.xz
Fix arecibo handler doubling error messages
-rw-r--r--Bugzilla/Error.pm33
1 files changed, 14 insertions, 19 deletions
diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm
index 2114bba47..e49f466d6 100644
--- a/Bugzilla/Error.pm
+++ b/Bugzilla/Error.pm
@@ -95,6 +95,20 @@ sub _throw_error {
my $template = Bugzilla->template;
my $message;
+ # There are some tests that throw and catch a lot of errors,
+ # and calling $template->process over and over for those errors
+ # is too slow. So instead, we just "die" with a dump of the arguments.
+ if (Bugzilla->error_mode != ERROR_MODE_TEST) {
+ $template->process($name, $vars, \$message)
+ || ThrowTemplateError($template->error());
+ }
+
+ # Let's call the hook first, so that extensions can override
+ # or extend the default behavior, or add their own error codes.
+ require Bugzilla::Hook;
+ Bugzilla::Hook::process('error_catch', { error => $error, vars => $vars,
+ message => \$message });
+
if (Bugzilla->error_mode == ERROR_MODE_WEBPAGE) {
if (arecibo_should_notify($vars->{error})) {
$vars->{maintainers_notified} = 1;
@@ -113,25 +127,6 @@ sub _throw_error {
$vars->{error}, $vars->{processed}->{error_message}, $vars->{uid});
}
}
-
- # There are some tests that throw and catch a lot of errors,
- # and calling $template->process over and over for those errors
- # is too slow. So instead, we just "die" with a dump of the arguments.
- if (Bugzilla->error_mode != ERROR_MODE_TEST) {
- $template->process($name, $vars, \$message)
- || ThrowTemplateError($template->error());
- }
-
- # Let's call the hook first, so that extensions can override
- # or extend the default behavior, or add their own error codes.
- require Bugzilla::Hook;
- Bugzilla::Hook::process('error_catch', { error => $error, vars => $vars,
- message => \$message });
-
- if (Bugzilla->error_mode == ERROR_MODE_WEBPAGE) {
- print Bugzilla->cgi->header();
- print $message;
- }
elsif (Bugzilla->error_mode == ERROR_MODE_TEST) {
die Dumper($vars);
}