diff --git a/src/Xero.php b/src/Xero.php index a692a86..b6bbed8 100755 --- a/src/Xero.php +++ b/src/Xero.php @@ -320,7 +320,7 @@ protected function guzzle(string $type, string $request, array $data = [], bool ]; } catch (RequestException $e) { $response = json_decode($e->response->body()); - throw new Exception($response->Detail ?? "Type: $response->Type Message: $response->Message Error Number: $response->ErrorNumber"); + throw new Exception($response->Detail ?? "Type: $response?->Type Message: $response?->Message Error Number: $response?->ErrorNumber"); } catch (Exception $e) { throw new Exception($e->getMessage()); }