added unauthorized exeption
Showing
1 changed file
with
3 additions
and
0 deletions
| ... | @@ -386,6 +386,9 @@ abstract class ImmoScoutAPI extends GuzzleClient | ... | @@ -386,6 +386,9 @@ abstract class ImmoScoutAPI extends GuzzleClient |
| 386 | ]; | 386 | ]; |
| 387 | if (!empty($res->getBody())) { | 387 | if (!empty($res->getBody())) { |
| 388 | try { | 388 | try { |
| 389 | if ($res->getStatusCode() == "401") { | ||
| 390 | throw new AuthException("Immoscout24-API: " . $res->getReasonPhrase()); | ||
| 391 | } | ||
| 389 | $json = json_decode($res->getBody(), true); | 392 | $json = json_decode($res->getBody(), true); |
| 390 | } catch (InvalidArgumentException $ex) { | 393 | } catch (InvalidArgumentException $ex) { |
| 391 | $json = []; | 394 | $json = []; | ... | ... |
-
Please register or sign in to post a comment