diff --git a/src/Bigcommerce/Api/Connection.php b/src/Bigcommerce/Api/Connection.php index 1e5f7fd1..d9cbd228 100644 --- a/src/Bigcommerce/Api/Connection.php +++ b/src/Bigcommerce/Api/Connection.php @@ -286,14 +286,14 @@ private function handleResponse() if ($status >= 400 && $status <= 499) { if ($this->failOnError) { - throw new ClientError($body, $status); + throw new ClientError(strval($body), $status); } else { $this->lastError = $body; return false; } } elseif ($status >= 500 && $status <= 599) { if ($this->failOnError) { - throw new ServerError($body, $status); + throw new ServerError(strval($body), $status); } else { $this->lastError = $body; return false;