Exceptions¶
Exceptions raised by the Barbara SDK.
BarbaraApiError ¶
BarbaraApiError(
message: str,
*,
status: Optional[int] = None,
body: Any = None,
)
Bases: RuntimeError
Base error for any non-2xx response from the Barbara API.
body is the server's raw error response (parsed JSON if the
response was JSON, otherwise raw text) — never the request you sent,
so it can't contain your credentials. It CAN still contain data about
the resource you were operating on (e.g. a validation error echoing
back a field value). Avoid logging exc.body indiscriminately in a
context you don't control — log str(exc)/exc.status instead
unless you specifically need the body for debugging.
BarbaraAuthError ¶
BarbaraAuthError(
message: str,
*,
status: Optional[int] = None,
body: Any = None,
)
BarbaraNotFoundError ¶
BarbaraNotFoundError(
message: str,
*,
status: Optional[int] = None,
body: Any = None,
)
BarbaraPermissionError ¶
BarbaraPermissionError(
message: str,
*,
status: Optional[int] = None,
body: Any = None,
)