Skip to content

API Reference parrot.clients.jev.exceptions

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.clients.jev.exceptions

View source

Exceptions raised by :class:~parrot.clients.jev.JevClient.

The HTTP status → exception mapping mirrors the official typesafe-sdk (TypeSafeBadRequestError for 400, TypeSafeAuthenticationError for 401, … TypeSafeInternalServerError for 5xx) so callers migrating from the vendor SDK find the same categories under the parrot namespace.

Class JevAPIError

An unsuccessful HTTP response from the TypeSafe API.

Parameter Type Default Description
message str
status int
body Any None
request_id Optional[str] None
retry_after Optional[float] None

Attributes:

Attribute Type Description
status int HTTP status code.
body Any Decoded JSON error body, raw text, or None when empty.
request_id Optional[str] The x-typesafe-request-id header when present.
retry_after Optional[float] Server-requested wait in seconds, parsed from retry-after-ms / retry-after; None when absent.

Class JevAuthenticationError

Authentication failed (401) or access was denied (403).

Class JevBadRequestError

The request was rejected as invalid (400) or failed server validation (422).

Class JevConfigurationError

A request could not be built: missing API key, no questions, bad state.

Class JevConnectionError

The request never produced an HTTP response (connection failure or timeout).

Class JevError

Base class for every error raised by the Jev client.

Class JevNotFoundError

The endpoint or model was not found (404).

Class JevRateLimitError

The rate limit was exceeded (429).

Class JevSchemaError

A Pydantic output type cannot be mapped onto System One questions (or back).

Class JevServerError

The server failed to process the request (5xx).

Alias ParrotError

Re-exported from parrot.exceptions.ParrotError.

Attribute REQUEST_ID_HEADER

Function api_error

Build the :class:JevAPIError subclass matching an HTTP status.

api_error(status: int, body: Any, headers: Optional[Mapping[str, str]] = None) -> JevAPIError

Parameter Type Default Description
status int HTTP status code of the failed response.
body Any Decoded JSON body, raw text, or None.
headers Optional[Mapping[str, str]] None Response headers, used for the request id and retry hints.

Returns: JevAPIError — A ready-to-raise :class:JevAPIError (or subclass) instance.

Function extract_message

Pull a human-readable message out of an API error body.

Understands the shapes the TypeSafe API emits: a bare string, {"error": ...}, {"message": ...}, {"detail": ...} and FastAPI-style {"detail": [{"loc": [...], "msg": ...}, ...]} validation lists.

extract_message(body: Any) -> Optional[str]

Parameter Type Default Description
body Any Decoded JSON body or raw text.

Returns: Optional[str] — The extracted message, or None when nothing usable was found.

Function parse_retry_after

Read the server's requested wait from the response headers.

Honors retry-after-ms first, then retry-after (seconds or an HTTP-date), mirroring the vendor SDK.

parse_retry_after(headers: Mapping[str, str]) -> Optional[float]

Parameter Type Default Description
headers Mapping[str, str] Response headers (case-insensitive mapping preferred).

Returns: Optional[float] — The wait in seconds, or None when no usable header is present.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally