code: def _check_for_errors(response, json_response):
          
          status_code = response.status_code
          try:
              response.raise_for_status()
          except requests.HTTPError as why:
              raise ApiError(str(why), reply_code=status_code)
          if isinstance(json_response, dict) and 'error' in json_response:
              raise ApiError(json_response['error'], reply_code=status_code)
docs: Check payload for errors.
  
          :param response: HTTP response
          :param json_response: Json response
  
          :raises ApiError: Raises if the remote server encountered an error.
  
          :return: