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

Class APIStatusError

src/opencode_ai/_exceptions.py:57–66  ·  view source on GitHub ↗

Raised when an API response has a status code of 4xx or 5xx.

Source from the content-addressed store, hash-verified

55
56
57class APIStatusError(APIError):
58 """Raised when an API response has a status code of 4xx or 5xx."""
59
60 response: httpx.Response
61 status_code: int
62
63 def __init__(self, message: str, *, response: httpx.Response, body: object | None) -> None:
64 super().__init__(message, response.request, body=body)
65 self.response = response
66 self.status_code = response.status_code
67
68
69class APIConnectionError(APIError):

Callers 2

_make_status_errorMethod · 0.85
_make_status_errorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected