---
title: prefactor_http.exceptions module
editUrl: true
head: []
template: doc
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

# prefactor_http.exceptions module

Exceptions for Prefactor HTTP Client.

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

Bases: [`PrefactorHttpError`](#prefactor_http.exceptions.PrefactorHttpError)

API returned an error response.

#### message

Human-readable error message

#### code

Error code from the API

#### status_code

HTTP status code

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

Bases: [`PrefactorApiError`](#prefactor_http.exceptions.PrefactorApiError)

Authentication/authorization errors (401, 403).

### *exception* prefactor_http.exceptions.PrefactorClientError

Bases: [`PrefactorHttpError`](#prefactor_http.exceptions.PrefactorHttpError)

Client-side error (not related to API).

### *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)

Bases: [`PrefactorApiError`](#prefactor_http.exceptions.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)

Bases: [`PrefactorHttpError`](#prefactor_http.exceptions.PrefactorHttpError)

Backend response violated the SDK’s expected response contract.

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

Bases: [`PrefactorHttpError`](#prefactor_http.exceptions.PrefactorHttpError)

All retry attempts exhausted.

#### last_error

The last exception that caused the retry to fail

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

Bases: [`PrefactorApiError`](#prefactor_http.exceptions.PrefactorApiError)

Validation errors (400, 422).

#### errors

Detailed validation errors mapping field names to error messages

### 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

Return True when the error is safe to retry later.