68508bef by fehrlich

added unauthorized exeption

1 parent 31d1c521
...@@ -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 = [];
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!