class_docstr: Deprecated, to be removed at gym 1.0.
class_docstr_tok: ["Deprecated",",","to","be","removed","at","gym","1.0","."]
docstr: Initialise API error.
docstr_tok: ["Initialise","API","error","."]
code: def __init__(
      self,
      message=None,
      http_body=None,
      http_status=None,
      json_body=None,
      headers=None,
  ):
      """Initialise API error."""
      super().__init__(message)
  
      warnings.warn(
          "APIError is deprecated and will be removed at gym 1.0"
      )
  
      if http_body and hasattr(http_body, "decode"):
          try:
              http_body = http_body.decode("utf-8")
          except Exception:
              http_body = "<Could not decode body as utf-8.>"
  
      self._message = message
      self.http_body = http_body
      self.http_status = http_status
      self.json_body = json_body
      self.headers = headers or {}
      self.request_id = self.headers.get("request-id", None)
  
imports: import warnings
label_desc: Use image node_id 1 to create a new APIError object from inherited base classes: Error with example: obj = APIError(message, http_body, http_status, json_body, headers)