[freeside-commits] branch FREESIDE_3_BRANCH updated. 6e083cee18cb70cfeea90eed475e452b2ff6a0f1

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


The branch, FREESIDE_3_BRANCH has been updated
       via  6e083cee18cb70cfeea90eed475e452b2ff6a0f1 (commit)
      from  8bc03bf0c430decad33d72a2ab380ffbecb2cc87 (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 6e083cee18cb70cfeea90eed475e452b2ff6a0f1
Author: Mark Wells <mark at freeside.biz>
Date:   Mon Apr 6 17:25:22 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 7ab6d28..40f30fe 100644
--- a/FS/FS/Misc/Geo.pm
+++ b/FS/FS/Misc/Geo.pm
@@ -17,7 +17,7 @@ FS::UID->install_callback( sub {
   $conf = new FS::Conf;
 } );
 
-$DEBUG = 0;
+$DEBUG = 1;
 
 @EXPORT_OK = qw( get_district );
 
@@ -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 |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list