Skip to content

Commit

Permalink
Bad api response not catch
Browse files Browse the repository at this point in the history
  • Loading branch information
jr-k authored Mar 24, 2021
1 parent 3d3196f commit c4ccab9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected function handleResponse(Response $response)
// inludes the success variable, we will return the response data.
if (!isset($content) || !($response->getStatusCode() == 302 || $response->isSuccess())) {
if ($response->getStatusCode() == 404) {
throw new ItemNotFoundException($content->error);
throw new ItemNotFoundException(isset($content->error) ? $content->error : "Error unknown.");
}

throw new PipedriveException(
Expand Down

0 comments on commit c4ccab9

Please sign in to comment.