aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport/Barnet.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Barnet.pm')
-rw-r--r--perllib/FixMyStreet/SendReport/Barnet.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/SendReport/Barnet.pm b/perllib/FixMyStreet/SendReport/Barnet.pm
index 9a54dd91d..ecbe82872 100644
--- a/perllib/FixMyStreet/SendReport/Barnet.pm
+++ b/perllib/FixMyStreet/SendReport/Barnet.pm
@@ -149,14 +149,21 @@ sub send {
'string' => $result->get_faultstring(),
'detail' => $result->get_detail(), # possibly only contains debug info
);
- $fault{$_}=~s/^\s*|\s*$//g foreach keys %fault;
+ foreach (keys %fault) {
+ $fault{$_}="" unless defined $fault{$_};
+ $fault{$_}=~s/^\s*|\s*$//g;
+ }
$fault{actor}&&=" (actor: $fault{actor})";
$fault{'detail'} &&= "\n" . $fault{'detail'};
$err_msg = "Failed (problem id $h{id}): Fault $fault{code}$fault{actor}\n$fault{string}$fault{detail}";
}
};
- 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";