Skip to content

Exceptions

PolarFlowError

polar_flow.exceptions.PolarFlowError

Bases: Exception

Base exception for polar-flow.

Attributes:

Name Type Description
endpoint

API endpoint that failed

status_code

HTTP status code

response_body

Response body (truncated to 500 chars)

__init__(message, *, endpoint=None, status_code=None, response_body=None)

Initialize polar flow error.

Parameters:

Name Type Description Default
message str

Error message

required
endpoint str | None

API endpoint that failed

None
status_code int | None

HTTP status code

None
response_body str | None

Response body

None

AuthenticationError

polar_flow.exceptions.AuthenticationError

Bases: PolarFlowError

Invalid or expired access token.

NotFoundError

polar_flow.exceptions.NotFoundError

Bases: PolarFlowError

Requested resource not found.

RateLimitError

polar_flow.exceptions.RateLimitError

Bases: PolarFlowError

Rate limit exceeded.

Attributes:

Name Type Description
retry_after

Number of seconds to wait before retrying

endpoint

API endpoint that failed

status_code

HTTP status code

response_body

Response body

__init__(message, retry_after, *, endpoint=None, status_code=None, response_body=None)

Initialize rate limit error.

Parameters:

Name Type Description Default
message str

Error message

required
retry_after int

Number of seconds to wait before retrying

required
endpoint str | None

API endpoint that failed

None
status_code int | None

HTTP status code

None
response_body str | None

Response body

None

ValidationError

polar_flow.exceptions.ValidationError

Bases: PolarFlowError

Invalid request parameters.