Skip to content

Exceptions

Custom exception hierarchy for the flex_mls package.

ApiError

Bases: Exception

Base exception for errors raised by the Flex MLS client.

Parameters:

Name Type Description Default
message str

Human-readable error message.

required
status_code int | None

Optional HTTP status code returned by the server.

None
response_data Any

Optional decoded response payload returned by Spark.

None
spark_code int | None

Optional Spark-specific error code.

None

AuthenticationError

Bases: ApiError

Raised when authentication credentials are missing or invalid.

AuthorizationError

Bases: ApiError

Raised when the current key or user lacks permission for a request.

ConfigurationError

Bases: ApiError

Raised when the client is misconfigured.

NetworkError

Bases: ApiError

Raised for client-side network errors.

NotFoundError

Bases: ApiError

Raised when the requested resource cannot be found.

RateLimitError

Bases: ApiError

Raised when the API rate limit has been exceeded.

ReplicationEndpointRequiredError

Bases: AuthorizationError

Raised when Spark requires the replication endpoint to be used.

ServerError

Bases: ApiError

Raised for 5xx upstream server failures.

ValidationError

Bases: ApiError

Raised when request parameters or payloads are invalid.