summaryrefslogtreecommitdiff
path: root/FS/FS/Misc/Geo.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-04-06 17:26:42 -0700
committerMark Wells <mark@freeside.biz>2015-04-06 17:29:37 -0700
commitfe529fcf74225297231dc3678594166720721205 (patch)
treed238368a7479d3f290c33af08315eb6f66d40eb1 /FS/FS/Misc/Geo.pm
parentb108f3292bd12e60f086c8f71129e69a0838d816 (diff)
better error handling on U.S. Census geocoding, #32250
Diffstat (limited to 'FS/FS/Misc/Geo.pm')
-rw-r--r--FS/FS/Misc/Geo.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/FS/FS/Misc/Geo.pm b/FS/FS/Misc/Geo.pm
index fc80548..1aa5939 100644
--- a/FS/FS/Misc/Geo.pm
+++ b/FS/FS/Misc/Geo.pm
@@ -334,8 +334,12 @@ sub standardize_uscensus {
censustract => $result->censustract,
};
} else {
- die "can't parse address '".$result->address."'";
+ die "Geocoding returned '".$result->address."', which does not seem to be a valid address.\n";
}
+ } elsif ( $result->match_level eq 'Tie' ) {
+ die "Geocoding was not able to identify a unique matching address.\n";
+ } elsif ( $result->match_level ) {
+ die "Geocoding did not find a matching address.\n";
} else {
warn Dumper($result) if $DEBUG;
die $result->error_message;