diff --git a/src/Geolocation.php b/src/Geolocation.php index e38bf26..e0ff3a4 100644 --- a/src/Geolocation.php +++ b/src/Geolocation.php @@ -79,6 +79,11 @@ protected function doCall($parameters = array()) // redefine response as json decoded $response = json_decode($response); + // API returns with an error + if (isset($response->error_message)) { + throw new GeolocationException($response->error_message); + } + // return the content return $response->results; }