code: def from_http_exception(cls, e):
          
          assert isinstance(e, requests.exceptions.HTTPError)
          response = e.response
          try:
              message = response.json()['message']
          except (KeyError, ValueError):
              message = response.content.strip()
  
          raise cls(message)
docs: Create ``APIError`` from ``requests.exception.HTTPError``.