SDK Exceptions
Both SDKs raise one class per failure mode, each carrying status_code / statusCode,
endpoint, and payload.
| Python | TypeScript | Raised on |
|---|---|---|
AISDKError | CustodianError | base class |
AuthenticationError | AuthenticationError | 401 — key missing / invalid / expired |
NotFoundError | NotFoundError | 404 — agent / app / squad not found |
ValidationError | ValidationError | 422 — bad request body |
ServerError | ServerError | 5xx, after retries |
APIConnectionError | APIConnectionError | network failure / timeout |
APIResponseError | APIResponseError | any other 4xx |
from custodian_labs import AISDKError
try:
...
except AISDKError as e:
print(e.status_code, e.endpoint)
import { CustodianError } from "@custodianlabs/sdk";
try {
// ...
} catch (e) {
if (e instanceof CustodianError) console.log(e.statusCode, e.endpoint);
}