private function _interpretResponse($httpBody, $httpStatus)
{
try {
$response = json_decode($httpBody, true);
} catch (\Exception $e) {
throw new Error("Invalid response body from API: HTTP Status: ({$httpStatus}) {$httpBody}", $httpStatus, $httpBody);
}
if ($httpStatus < 200 || $httpStatus >= 300) {
$this->handleApiError($httpBody, $httpStatus, $response);
}
return $response;
}