Module

_errors

Error hierarchy for pounce.

All pounce errors inherit from PounceError. Each error maps to an HTTP status code for automatic error response generation.

Error categories:

  • ParseError: malformed HTTP from the client (400)
  • RequestTimeoutError: request or keep-alive timeout (408)
  • LimitError: headers or body exceed configured limits (413/431)
  • AppError: the ASGI application raised an exception (500)
  • LifespanError: lifespan startup or shutdown failure (500)
  • SupervisorError: worker spawn or crash-restart failure (500)
  • WorkerError: worker-level failure reported to supervisor (500)
  • TLSError: TLS configuration or handshake failure (500)
  • ReloadError: file-watcher or worker-restart failure during reload (500)

Classes

PounceError 2
Base exception for all pounce server errors.

Base exception for all pounce server errors.

Attributes

Name Type Description
status_code int

Methods

Internal Methods 1
__init__ 2
def __init__(self, message: str, *, status_code: int | None = None) -> None
Parameters
Name Type Description
message
status_code Default:None
ParseError 1
Malformed HTTP request — h11 could not parse the input.

Malformed HTTP request — h11 could not parse the input.

Attributes

Name Type Description
status_code int
RequestTimeoutError 1
Request or keep-alive timeout exceeded. Named ``RequestTimeoutError`` to avoid shadowing the built…

Request or keep-alive timeout exceeded.

NamedRequestTimeoutErrorto avoid shadowing the builtin TimeoutError (which is a subclass of OSError).

Attributes

Name Type Description
status_code int
LimitError 1
Request headers or body exceed configured size limits. Default status is 413 (Content Too Large). …

Request headers or body exceed configured size limits.

Default status is 413 (Content Too Large). Passstatus_code=431 for header-specific limits (Request Header Fields Too Large).

Attributes

Name Type Description
status_code int
AppError 1
The ASGI application raised an unhandled exception.

The ASGI application raised an unhandled exception.

Attributes

Name Type Description
status_code int
LifespanError 1
ASGI lifespan startup or shutdown failed.

ASGI lifespan startup or shutdown failed.

Attributes

Name Type Description
status_code int
SupervisorError 1
Worker spawn failure or crash-restart exhaustion.

Worker spawn failure or crash-restart exhaustion.

Attributes

Name Type Description
status_code int
WorkerError 1
Worker-level failure that bubbles to the supervisor.

Worker-level failure that bubbles to the supervisor.

Attributes

Name Type Description
status_code int
TLSError 1
TLS configuration or handshake failure.

TLS configuration or handshake failure.

Attributes

Name Type Description
status_code int
ReloadError 1
File-watcher or worker-restart failure during reload.

File-watcher or worker-restart failure during reload.

Attributes

Name Type Description
status_code int