diff options
author | bugreport%peshkin.net <> | 2004-11-08 10:25:58 +0000 |
---|---|---|
committer | bugreport%peshkin.net <> | 2004-11-08 10:25:58 +0000 |
commit | 7ab8441582a6b9ce1b2335762948662b38aaf217 (patch) | |
tree | 2b6e3430cf432480102664b43dbc6b3416817e59 /Bugzilla/Error.pm | |
parent | 1f389b9186fb57c781c59fdf38caa45e69912324 (diff) | |
download | bugs-7ab8441582a6b9ce1b2335762948662b38aaf217.tar bugs-7ab8441582a6b9ce1b2335762948662b38aaf217.tar.gz bugs-7ab8441582a6b9ce1b2335762948662b38aaf217.tar.bz2 bugs-7ab8441582a6b9ce1b2335762948662b38aaf217.tar.xz bugs-7ab8441582a6b9ce1b2335762948662b38aaf217.zip |
Bug 257344: Remove exit from error handlers when non-interactive
r=glob,justdave
a=justdave
Diffstat (limited to 'Bugzilla/Error.pm')
-rw-r--r-- | Bugzilla/Error.pm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm index 25527f599..00a2675eb 100644 --- a/Bugzilla/Error.pm +++ b/Bugzilla/Error.pm @@ -69,12 +69,17 @@ sub _throw_error { close ERRORLOGFID; } - print Bugzilla->cgi->header(); - my $template = Bugzilla->template; - $template->process($name, $vars) - || ThrowTemplateError($template->error()); - + if (Bugzilla->batch) { + my $message; + $template->process($name, $vars, \$message) + || ThrowTemplateError($template->error()); + die("$message"); + } else { + print Bugzilla->cgi->header(); + $template->process($name, $vars) + || ThrowTemplateError($template->error()); + } exit; } @@ -90,6 +95,9 @@ sub ThrowTemplateError { my ($template_err) = @_; my $vars = {}; + if (Bugzilla->batch) { + die("error: template error: $template_err"); + } $vars->{'template_error_msg'} = $template_err; $vars->{'error'} = "template_error"; |