summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Hook.pm
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-11-10 17:08:13 +0100
committerDavid Lawrence <dkl@mozilla.com>2014-11-10 17:08:13 +0100
commitb9543e48f33729c4a4560eac2a856af06ed9e9d5 (patch)
tree4db2a797fc4f138a74ad09551b273bcf1b61785b /Bugzilla/Hook.pm
parent41dbccc20f013f0b06959ad587f5fb6ac4813686 (diff)
downloadbugzilla-b9543e48f33729c4a4560eac2a856af06ed9e9d5.tar.gz
bugzilla-b9543e48f33729c4a4560eac2a856af06ed9e9d5.tar.xz
Bug 1094858: Create hook in Bugzilla::WebService::Constants to allow overrriding of standard status codes by extensions
r=gerv,a=glob
Diffstat (limited to 'Bugzilla/Hook.pm')
-rw-r--r--Bugzilla/Hook.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm
index 2904acba1..430d5af49 100644
--- a/Bugzilla/Hook.pm
+++ b/Bugzilla/Hook.pm
@@ -1704,6 +1704,26 @@ The current JSONRPC, XMLRPC, or REST object.
=back
+=head2 webservice_status_code_map
+
+This hook allows an extension to change the status codes returned by
+specific webservice errors. The valid internal error codes that Bugzilla
+generates, and the status codes they map to by default, are defined in the
+C<WS_ERROR_CODE> constant in C<Bugzilla::WebService::Constants>. When
+remapping an error, you may wish to use an existing status code constant.
+Such constants are also in C<Bugzilla::WebService::Constants> and start
+with C<STATUS_*> such as C<STATUS_BAD_REQUEST>.
+
+Params:
+
+=over
+
+=item C<status_code_map>
+
+A hash reference containing the current status code mapping.
+
+=back
+
=head1 SEE ALSO
L<Bugzilla::Extension>