diff options
Diffstat (limited to 'Bugzilla/Error.pm')
-rw-r--r-- | Bugzilla/Error.pm | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm index 1bb0556af..95088850e 100644 --- a/Bugzilla/Error.pm +++ b/Bugzilla/Error.pm @@ -81,16 +81,21 @@ sub _throw_error { $template->process($name, $vars) || ThrowTemplateError($template->error()); } - elsif (Bugzilla->error_mode == ERROR_MODE_DIE) { + else { my $message; $template->process($name, $vars, \$message) || ThrowTemplateError($template->error()); - die("$message\n"); - } - elsif (Bugzilla->error_mode == ERROR_MODE_DIE_SOAP_FAULT) { - die SOAP::Fault - ->faultcode(ERROR_GENERAL) - ->faultstring($error); + if (Bugzilla->error_mode == ERROR_MODE_DIE) { + die("$message\n"); + } + elsif (Bugzilla->error_mode == ERROR_MODE_DIE_SOAP_FAULT) { + my $code = WS_ERROR_CODE->{$error}; + if (!$code) { + $code = ERROR_UNKNOWN_FATAL if $name =~ /code/i; + $code = ERROR_UNKNOWN_TRANSIENT if $name =~ /user/i; + } + die SOAP::Fault->faultcode($code)->faultstring($message); + } } exit; } |