aboutsummaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-11-10 16:08:13 +0000
committerDavid Lawrence <dkl@mozilla.com>2014-11-10 16:10:06 +0000
commit4e5a3b1633b0f75611da16d2520a3fc27d15673e (patch)
tree847f59881ff2cd1ff8431bf1a07c8d13a3b332f6 /extensions
parent0d7b9c62b132c945114de061eb3d783fd4344e0e (diff)
downloadbugs-4e5a3b1633b0f75611da16d2520a3fc27d15673e.tar
bugs-4e5a3b1633b0f75611da16d2520a3fc27d15673e.tar.gz
bugs-4e5a3b1633b0f75611da16d2520a3fc27d15673e.tar.bz2
bugs-4e5a3b1633b0f75611da16d2520a3fc27d15673e.tar.xz
bugs-4e5a3b1633b0f75611da16d2520a3fc27d15673e.zip
Bug 1094858: Create hook in Bugzilla::WebService::Constants to allow overrriding of standard status codes by extensions
r=gerv,a=glob
Diffstat (limited to 'extensions')
-rw-r--r--extensions/Example/Extension.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm
index 256589dab..af36b107a 100644
--- a/extensions/Example/Extension.pm
+++ b/extensions/Example/Extension.pm
@@ -21,6 +21,7 @@ use Bugzilla::User::Setting;
use Bugzilla::Util qw(diff_arrays html_quote);
use Bugzilla::Status qw(is_open_state);
use Bugzilla::Install::Filesystem;
+use Bugzilla::WebService::Constants;
# This is extensions/Example/lib/Util.pm. I can load this here in my
# Extension.pm only because I have a Config.pm.
@@ -958,11 +959,20 @@ sub webservice {
sub webservice_error_codes {
my ($self, $args) = @_;
-
+
my $error_map = $args->{error_map};
$error_map->{'example_my_error'} = 10001;
}
+sub webservice_status_code_map {
+ my ($self, $args) = @_;
+
+ my $status_code_map = $args->{status_code_map};
+ # Uncomment this line to override the status code for the
+ # error 'object_does_not_exist' to STATUS_BAD_REQUEST
+ #$status_code_map->{51} = STATUS_BAD_REQUEST;
+}
+
sub webservice_before_call {
my ($self, $args) = @_;