diff options
Diffstat (limited to 'perllib/FixMyStreet/Geocode')
-rw-r--r-- | perllib/FixMyStreet/Geocode/Zurich.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Geocode/Zurich.pm b/perllib/FixMyStreet/Geocode/Zurich.pm index 9cffc7a32..29c3ebdbb 100644 --- a/perllib/FixMyStreet/Geocode/Zurich.pm +++ b/perllib/FixMyStreet/Geocode/Zurich.pm @@ -58,7 +58,13 @@ sub string { my $search = SOAP::Data->name('search' => $s)->type(''); my $count = SOAP::Data->name('count' => 10)->type(''); - my $result = $soap->call($method, $security, $search, $count); + my $result; + eval { + $result = $soap->call($method, $security, $search, $count); + }; + if ($@) { + return { error => 'The geocoder appears to be down.' }; + } $result = $result->result; if (!$result || !$result->{Location}) { |