From ce8f837dcd1ccd23cd5f63f258efd257e3de70f3 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 30 May 2012 11:39:09 +0800 Subject: Bug 759093: don't report most webservice errors to arecibo --- Bugzilla/Arecibo.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Bugzilla/Arecibo.pm b/Bugzilla/Arecibo.pm index 3e1df3156..974594b72 100644 --- a/Bugzilla/Arecibo.pm +++ b/Bugzilla/Arecibo.pm @@ -27,6 +27,7 @@ use Sys::Hostname; use Bugzilla::Constants; use Bugzilla::Util; +use Bugzilla::WebService::Constants; use constant CONFIG => { # 'types' maps from the error message to types and priorities @@ -127,8 +128,21 @@ sub arecibo_handle_error { # don't send to arecibo unless configured my $arecibo_server = Bugzilla->params->{arecibo_server} || ''; my $send_to_arecibo = $arecibo_server ne ''; + + # web service filtering + if ($send_to_arecibo + && (Bugzilla->error_mode == ERROR_MODE_DIE_SOAP_FAULT || Bugzilla->error_mode == ERROR_MODE_JSON_RPC)) + { + my ($code) = $message =~ /^(-?\d+): /; + if ($code + && !($code == ERROR_UNKNOWN_FATAL || $code == ERROR_UNKNOWN_TRANSIENT)) + { + $send_to_arecibo = 0; + } + } + + # message content filtering if ($send_to_arecibo) { - # message content filtering foreach my $re (@{CONFIG->{ignore}}) { if ($message =~ $re) { $send_to_arecibo = 0; -- cgit v1.2.3-24-g4f1b