WrennError to handle all API errors in one place.
Base class
All SDK exceptions inherit fromWrennError. 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
UseWrennError 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 singletry block:
Importing exceptions
All exception classes are importable directly from thewrenn package: