diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-12-06 10:22:11 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-12-06 10:22:11 +0000 |
commit | 55ae92c2de49b6451f446e27c5a564673f892f88 (patch) | |
tree | 08e375eb35e2998bf9c33cc0bbff1febb656783b /perllib/FixMyStreet/Geocode | |
parent | af68aee64765c425e893756c1a97244488b7c4c5 (diff) |
Catch 500 error from geocoder.
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}) { |