Skip to content

Commit 20655c7

Browse files
Merge pull request #10 from janverton/master
Fixes #9
2 parents 172451a + eb12ef5 commit 20655c7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Geolocation.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ protected function doCall($parameters = array())
7979
// redefine response as json decoded
8080
$response = json_decode($response);
8181

82+
// API returns with an error
83+
if (isset($response->error_message)) {
84+
throw new GeolocationException($response->error_message);
85+
}
86+
8287
// return the content
8388
return $response->results;
8489
}

0 commit comments

Comments
 (0)