MCPcopy Create free account
hub / github.com/anomalyco/opencode-sdk-python / APIError

Class APIError

src/opencode_ai/_exceptions.py:25–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24
25class APIError(OpencodeError):
26 message: str
27 request: httpx.Request
28
29 body: object | None
30 """The API response body.
31
32 If the API responded with a valid JSON structure then this property will be the
33 decoded result.
34
35 If it isn't a valid JSON structure then this will be the raw response.
36
37 If there was no response associated with this error then it will be `None`.
38 """
39
40 def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: # noqa: ARG002
41 super().__init__(message)
42 self.request = request
43 self.message = message
44 self.body = body
45
46
47class APIResponseValidationError(APIError):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected