aito.client.v2.errors

Errors raised by the Aito v2 client

An error from the query path comes back as the structured error kind:

{"kind": "error", "data": {"code": "not_found", "message": "x not found"}}

AitoV2Error parses that into a machine-readable code so callers branch on the code instead of matching substrings of the message.

Not every v2 error is that shape yet, though the spec says it should be. The schema and data endpoints fall through to the handler they share with v1 and answer a missing table with the flat v1 body instead:

GET /api/v2/schema/no_such_thing
→ 404 {"message": "No such table: no_such_thing", "status": 404}

There is no code in that, so code is None on exactly the path a drop-if-exists loader takes. is_not_found falls back to the HTTP status for that reason — use it rather than comparing the code yourself. (Filed against the engine; when it emits the structured shape everywhere, the fallback becomes redundant rather than wrong.)

Exceptions

AitoV2Error(message[, code, status_code, body])

An error occurred when calling the Aito v2 API

AitoV2ResponseError(message[, code, ...])

The response was not the shape the requested operation produces