| 23 | |
| 24 | |
| 25 | class 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 | |
| 47 | class APIResponseValidationError(APIError): |
nothing calls this directly
no outgoing calls
no test coverage detected