aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Geocode
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-12-06 10:22:11 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-12-06 10:22:11 +0000
commit55ae92c2de49b6451f446e27c5a564673f892f88 (patch)
tree08e375eb35e2998bf9c33cc0bbff1febb656783b /perllib/FixMyStreet/Geocode
parentaf68aee64765c425e893756c1a97244488b7c4c5 (diff)
Catch 500 error from geocoder.
Diffstat (limited to 'perllib/FixMyStreet/Geocode')
-rw-r--r--perllib/FixMyStreet/Geocode/Zurich.pm8
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}) {