diff options
author | Dave Whiteland <dave@mysociety.org> | 2012-06-08 10:33:43 +0100 |
---|---|---|
committer | Dave Whiteland <dave@mysociety.org> | 2012-06-08 10:33:43 +0100 |
commit | bf94b1246c49c1ec2d2041be10176e42598d0699 (patch) | |
tree | cf3aa2c449a2e822fbbc6d6074394b5c01c4521a /perllib | |
parent | aabfdd765ea0217c12307a1effa3852c00eac6a4 (diff) |
after overnight messages, apply Barnet timeout message tidying to the output as well as to send_fail_reason
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/SendReport/Barnet.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/SendReport/Barnet.pm b/perllib/FixMyStreet/SendReport/Barnet.pm index 311c09318..ecbe82872 100644 --- a/perllib/FixMyStreet/SendReport/Barnet.pm +++ b/perllib/FixMyStreet/SendReport/Barnet.pm @@ -159,14 +159,16 @@ sub send { } }; - print "$err_msg\n" if $err_msg; + if ($err_msg) { + # for timeouts, we can tidy the message a wee bit (i.e. strip the 'error deserializing...' message) + $err_msg=~s/(?:Error deserializing message:.*)(Can't connect to [a-zA-Z0-9.:]+\s*\(Connection timed out\)).*/$1/s; + print "$err_msg\n"; + } if ($@) { my $e = shift; print "Caught an error: $@\n"; } if ( $return ) { - # for timeouts, we can tidy the message a wee bit (i.e. strip the 'error deserializing...' message) - $err_msg=~s/(?:Error deserializing message:.*)(Can't connect to [a-zA-Z0-9.:]+\s*\(Connection timed out\)).*/$1/s; $self->error( "Error sending to Barnet: $err_msg" ); } $self->success( !$return ); |