Portal
SandboxAPI v1Not signed inExternal user: —

Errors

Exception hierarchy (all inherit from FoodAPIError): classDiagram Exception <|-- FoodAPIError FoodAPIError <|-- AuthenticationError FoodAPIError <|--…

Exception hierarchy (all inherit from FoodAPIError):

classDiagram
    Exception <|-- FoodAPIError
    FoodAPIError <|-- AuthenticationError
    FoodAPIError <|-- RateLimitError
    FoodAPIError <|-- ValidationError
    FoodAPIError <|-- NotFoundError
    FoodAPIError <|-- ServerError

foodapi.exceptions.FoodAPIError

FoodAPIError(
    message: str,
    *,
    status_code: int | None = None,
    request_id: str | None = None,
    body: dict[str, Any] | None = None
)

Bases: Exception

Base error for all FoodAPI SDK failures.

foodapi.exceptions.AuthenticationError

AuthenticationError(
    message: str,
    *,
    status_code: int | None = None,
    request_id: str | None = None,
    body: dict[str, Any] | None = None
)

Bases: FoodAPIError

Invalid or missing credentials (401).

foodapi.exceptions.RateLimitError

RateLimitError(
    message: str,
    *,
    status_code: int | None = 429,
    request_id: str | None = None,
    body: dict[str, Any] | None = None,
    retry_after_seconds: int | None = None
)

Bases: FoodAPIError

Rate limit exceeded (429).

foodapi.exceptions.ValidationError

ValidationError(
    message: str,
    *,
    status_code: int | None = None,
    request_id: str | None = None,
    body: dict[str, Any] | None = None
)

Bases: FoodAPIError

Request validation failed (400, 422).

foodapi.exceptions.NotFoundError

NotFoundError(
    message: str,
    *,
    status_code: int | None = None,
    request_id: str | None = None,
    body: dict[str, Any] | None = None
)

Bases: FoodAPIError

Resource not found (404).

foodapi.exceptions.ServerError

ServerError(
    message: str,
    *,
    status_code: int | None = None,
    request_id: str | None = None,
    body: dict[str, Any] | None = None
)

Bases: FoodAPIError

Server or gateway error (5xx).

Exception paths

HTTP status Exception Attributes
401, 403 AuthenticationError status_code, request_id, body
400, 422 ValidationError body may contain field errors
404 NotFoundError
429 RateLimitError retry_after_seconds
500–599 ServerError retried per max_retries
Network / timeout FoodAPIError no status_code