From c4ccab9e0726dfd6fd0d037abde999dc6fea7013 Mon Sep 17 00:00:00 2001 From: JRK <3283866+jr-k@users.noreply.github.com> Date: Wed, 24 Mar 2021 15:59:15 +0100 Subject: [PATCH] Bad api response not catch --- src/Http/Request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Http/Request.php b/src/Http/Request.php index 81557fd..977396e 100644 --- a/src/Http/Request.php +++ b/src/Http/Request.php @@ -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(