[freeside-commits] branch master updated. fe529fcf74225297231dc3678594166720721205

Mark Wells mark at 420.am
Mon Apr 6 17:30:06 PDT 2015


The branch, master has been updated
       via  fe529fcf74225297231dc3678594166720721205 (commit)
      from  b108f3292bd12e60f086c8f71129e69a0838d816 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fe529fcf74225297231dc3678594166720721205
Author: Mark Wells <mark at freeside.biz>
Date:   Mon Apr 6 17:26:42 2015 -0700

    better error handling on U.S. Census geocoding, #32250

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;

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Misc/Geo.pm |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list