MCPcopy Create free account
hub / github.com/instantdb/instant / InstantAPIError

Class InstantAPIError

client/packages/python/src/instantdb/_errors.py:8–24  ·  view source on GitHub ↗

Raised when the Instant API returns a non-2xx response.

Source from the content-addressed store, hash-verified

6
7
8class InstantAPIError(InstantError):
9 """Raised when the Instant API returns a non-2xx response."""
10
11 status: int
12 body: Any
13 hint: Any
14 trace_id: str | None
15
16 def __init__(self, message: str, *, status: int, body: Any = None) -> None:
17 super().__init__(message)
18 self.status = status
19 self.body = body
20 # Surface hint/trace_id as attributes (like JS), not just inside body.
21 self.hint = body.get("hint") if isinstance(body, dict) else None
22 self.trace_id = (
23 body.get("traceId") or body.get("trace-id") if isinstance(body, dict) else None
24 )

Callers 6

api_error_from_responseFunction · 0.90
_handle_messageMethod · 0.90
_runMethod · 0.90
_on_messageMethod · 0.90
_materialize_loopMethod · 0.90
_handle_error_msgMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected