summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Error.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-05-28 05:08:59 +0200
committermkanat%bugzilla.org <>2008-05-28 05:08:59 +0200
commite0db56e755e94e07677faa3729a4affe38a3ce18 (patch)
tree4aaaa2e81eca3dd0379c16982bbed3754bc59a62 /Bugzilla/Error.pm
parent993a1c53229e174d4c2bd1d67acef6363c12db50 (diff)
downloadbugzilla-e0db56e755e94e07677faa3729a4affe38a3ce18.tar.gz
bugzilla-e0db56e755e94e07677faa3729a4affe38a3ce18.tar.xz
Bug 435507: Provide a method of hooking the WebService error codes
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=ghendricks, a=mkanat
Diffstat (limited to 'Bugzilla/Error.pm')
-rw-r--r--Bugzilla/Error.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm
index 3e5688e2a..d15336a81 100644
--- a/Bugzilla/Error.pm
+++ b/Bugzilla/Error.pm
@@ -102,7 +102,12 @@ sub _throw_error {
die("$message\n");
}
elsif (Bugzilla->error_mode == ERROR_MODE_DIE_SOAP_FAULT) {
- my $code = WS_ERROR_CODE->{$error};
+ # Clone the hash so we aren't modifying the constant.
+ my %error_map = %{ WS_ERROR_CODE() };
+ require Bugzilla::Hook;
+ Bugzilla::Hook::process('webservice-error_codes',
+ { error_map => \%error_map });
+ my $code = $error_map{$error};
if (!$code) {
$code = ERROR_UNKNOWN_FATAL if $name =~ /code/i;
$code = ERROR_UNKNOWN_TRANSIENT if $name =~ /user/i;