Skip to main content
The Wrenn SDK maps every HTTP error response to a typed Python exception. Instead of inspecting raw status codes, you catch the specific exception class that matches the failure — or catch the base WrennError to handle all API errors in one place.

Base class

All SDK exceptions inherit from WrennError. Every instance exposes three attributes:

Error reference

WrennHostHasCapsulesError

WrennHostHasCapsulesError is a subclass of WrennConflictError and adds one extra attribute: Use .capsule_ids to destroy or pause the blocking capsules before retrying.

Catching errors

Catch all API errors

Use WrennError as a catch-all when you want to handle any API failure uniformly:

Catch specific errors

Import and catch the typed exception you expect:

Handle multiple error types

You can match multiple exception types in a single try block:
Always place more specific exception types before the base WrennError catch. Python evaluates except clauses in order, so a broad catch placed first will swallow the typed ones below it.

Importing exceptions

All exception classes are importable directly from the wrenn package: