Skip to content

prefactor_http.exceptions module

Exceptions for Prefactor HTTP Client.

exception prefactor_http.exceptions.PrefactorApiError(message: str, code: str, status_code: int)

Section titled “exception prefactor_http.exceptions.PrefactorApiError(message: str, code: str, status_code: int)”

Bases: PrefactorHttpError

API returned an error response.

Human-readable error message

Error code from the API

HTTP status code

exception prefactor_http.exceptions.PrefactorAuthError(message: str, code: str, status_code: int)

Section titled “exception prefactor_http.exceptions.PrefactorAuthError(message: str, code: str, status_code: int)”

Bases: PrefactorApiError

Authentication/authorization errors (401, 403).

exception prefactor_http.exceptions.PrefactorClientError

Section titled “exception prefactor_http.exceptions.PrefactorClientError”

Bases: PrefactorHttpError

Client-side error (not related to API).

exception prefactor_http.exceptions.PrefactorHttpError

Section titled “exception prefactor_http.exceptions.PrefactorHttpError”

Bases: Exception

Base exception for all HTTP client errors.

exception prefactor_http.exceptions.PrefactorNotFoundError(message: str, code: str, status_code: int)

Section titled “exception prefactor_http.exceptions.PrefactorNotFoundError(message: str, code: str, status_code: int)”

Bases: PrefactorApiError

Resource not found (404).

exception prefactor_http.exceptions.PrefactorResponseContractError(message: str, , status_code: int | None = None, body_snippet: str | None = None, cause: Exception | None = None)

Section titled “exception prefactor_http.exceptions.PrefactorResponseContractError(message: str, , status_code: int | None = None, body_snippet: str | None = None, cause: Exception | None = None)”

Bases: PrefactorHttpError

Backend response violated the SDK’s expected response contract.

exception prefactor_http.exceptions.PrefactorRetryExhaustedError(message: str, last_error: Exception | None = None)

Section titled “exception prefactor_http.exceptions.PrefactorRetryExhaustedError(message: str, last_error: Exception | None = None)”

Bases: PrefactorHttpError

All retry attempts exhausted.

The last exception that caused the retry to fail

exception prefactor_http.exceptions.PrefactorValidationError(message: str, code: str, status_code: int, errors: dict)

Section titled “exception prefactor_http.exceptions.PrefactorValidationError(message: str, code: str, status_code: int, errors: dict)”

Bases: PrefactorApiError

Validation errors (400, 422).

Detailed validation errors mapping field names to error messages

prefactor_http.exceptions.is_permanent_http_error(error: Exception) → bool

Section titled “prefactor_http.exceptions.is_permanent_http_error(error: Exception) → bool”

Return True when retrying the same operation should stop immediately.

prefactor_http.exceptions.is_transient_http_error(error: Exception) → bool

Section titled “prefactor_http.exceptions.is_transient_http_error(error: Exception) → bool”

Return True when the error is safe to retry later.