summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Error.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-10-05 05:20:59 +0200
committermkanat%bugzilla.org <>2006-10-05 05:20:59 +0200
commitd5d46fd5894b7339532c4f7576c8aa55ce44d285 (patch)
tree34cfaa94ec279694af26e426e965996895000865 /Bugzilla/Error.pm
parent8d5dd5786873437f9fa840679cd94172e8ca30f1 (diff)
downloadbugzilla-d5d46fd5894b7339532c4f7576c8aa55ce44d285.tar.gz
bugzilla-d5d46fd5894b7339532c4f7576c8aa55ce44d285.tar.xz
Bug 351175: The WebService interface should include the error text along with the error name
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=Wurblzap, a=myk
Diffstat (limited to 'Bugzilla/Error.pm')
-rw-r--r--Bugzilla/Error.pm19
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;
}