Skip to content

Commit

Permalink
Merge pull request #105 from simensen/better-error-handling-when-cont…
Browse files Browse the repository at this point in the history
…ent-is-null

If content is null this throws another exception
  • Loading branch information
IsraelOrtuno committed Mar 24, 2021
2 parents b2c6022 + 0dc0476 commit 92bb79e
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 92bb79e

Please sign in to comment.