Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa2bc39

Browse files
committed
Merge pull request #435 from iMi-digital/master
Made Google auth failures more verbose
2 parents c2f1e98 + 732886e commit fa2bc39

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Geocoder/Provider/GoogleMaps.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
namespace Geocoder\Provider;
1212

13+
use Exception;
1314
use Geocoder\Exception\InvalidCredentials;
1415
use Geocoder\Exception\NoResult;
1516
use Geocoder\Exception\QuotaExceeded;
@@ -157,6 +158,11 @@ private function executeQuery($query)
157158
throw new InvalidCredentials(sprintf('API key is invalid %s', $query));
158159
}
159160

161+
if ('REQUEST_DENIED' === $json->status) {
162+
throw new Exception(sprintf('API access denied. Request: %s - Message: %s',
163+
$query, $json->error_message));
164+
}
165+
160166
// you are over your quota
161167
if ('OVER_QUERY_LIMIT' === $json->status) {
162168
throw new QuotaExceeded(sprintf('Daily quota exceeded %s', $query));

0 commit comments

Comments
 (0)