Errors

exception sans.errors.AgentNotSetError

Bases: RuntimeError

Exception raised when you haven’t yet set a user agent via sans.set_agent

exception sans.errors.BadRequest(message: str, *, request: Request, response: Response)

Bases: ClientError

httpx.HTTPStatusError for 400: Bad Request status codes.

exception sans.errors.ClientError(message: str, *, request: Request, response: Response)

Bases: HTTPStatusError

httpx.HTTPStatusError for 4XX: Client Error status codes.

exception sans.errors.Conflict(message: str, *, request: Request, response: Response)

Bases: ClientError

httpx.HTTPStatusError for 409: Conflict status codes.

exception sans.errors.Forbidden(message: str, *, request: Request, response: Response)

Bases: ClientError

httpx.HTTPStatusError for 403: Forbidden status codes.

exception sans.errors.HTTPStatusError(message: str, *, request: Request, response: Response)

Bases: HTTPError

The response had an error HTTP status of 4xx or 5xx.

May be raised when calling response.raise_for_status()

exception sans.errors.NotFound(message: str, *, request: Request, response: Response)

Bases: ClientError

httpx.HTTPStatusError for 404: Not Found status codes.

exception sans.errors.PrivateCommandError(*args: object, response: Response)

Bases: Exception

Exception raised when a private command failed to execute.

args

The reason for the failure

Type:

tuple[str]

request

The request which generated the failure

Type:

httpx.Request

response

The server response

Type:

httpx.Response

exception sans.errors.ServerError(message: str, *, request: Request, response: Response)

Bases: HTTPStatusError

httpx.HTTPStatusError for 5XX: Server Error status codes.

exception sans.errors.Teapot(message: str, *, request: Request, response: Response)

Bases: ClientError

httpx.HTTPStatusError for 418: I’m a Teapot status codes.

exception sans.errors.TooManyRequests(message: str, *, request: Request, response: Response)

Bases: ClientError

httpx.HTTPStatusError for 429: Too Many Requests status codes.