ProviderHTTPError#

Connect a provider and configure retries, credentials, and transport. See the guide.

class zett_agent.providers.base.ProviderHTTPError(message, *, status_code, reason=None, preview='', is_html=False)[源代码]#

The provider answered with an HTTP failure, or with something that was not an API reply.

The message says what was received: the status, the provider's own explanation when the body was a JSON error, and whether it was a web page (a proxy, gateway, firewall or login page in front of the API). The original SDK error stays on __cause__.

参数:
  • message (str)

  • status_code (int)

  • reason (str | None)

  • preview (str)

  • is_html (bool)

status_code#

The HTTP status of the response.

reason#

The provider's own explanation, or None when the body had none.

preview#

The start of the body as plain text, for a body with no explanation.

is_html#

Whether the body was a web page.