Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
better messaging for google reponse errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pjaudiomv committed May 6, 2019
1 parent 2eace61 commit 082cbf8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -24,6 +24,10 @@ CHANGELIST

***bmlt_translator Version 1.1.1* ** *- December 16, 2018*

- Updated Google API response code messages.

***bmlt_translator Version 1.1.1* ** *- December 16, 2018*

- Longitude/Latitude for NAWS dump translation table should be uppercased.
- Added support for Google API keys to be able to properly geocode.

Expand Down
10 changes: 7 additions & 3 deletions bmlt_translator/bmlt_import.php
Expand Up @@ -2,7 +2,7 @@
/***********************************************************************/
/** \file bmlt_import.php
\version 1.1.1
\version 1.1.2
\brief This file contains a range of functions to be used by BMLT database importing scripts. Including this file instantiates a BMLT root server.
Expand Down Expand Up @@ -380,11 +380,15 @@ function bmlt_geocode ( $in_address, ///< The address, in a single string, to be
$ret = array ( 'original' => $in_address, 'result' => bmlt_parse_gecode_result ( $xml->result, $in_isPublished ) );
$retry = false;
}
elseif ( $xml->status == 'OVER_QUERY_LIMIT' )
elseif ( ( $xml->status == 'OVER_QUERY_LIMIT' ) || ($xml->status == 'OVER_DAILY_LIMIT') )
{
die ( 'Over Google Maps API Query Limit' );
}
elseif ( ($xml->status == 'REQUEST_DENIED') || ($xml->status == 'INVALID_REQUEST') )
elseif ($xml->status == 'REQUEST_DENIED')
{
die ( 'Problem with API Key ('.htmlspecialchars ( $uri ).')' );
}
elseif ($xml->status == 'INVALID_REQUEST')
{
die ( 'Invalid Geocode URL ('.htmlspecialchars ( $uri ).')' );
}
Expand Down

0 comments on commit 082cbf8

Please sign in to comment.