You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b5e0c8e
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -128,6 +129,32 @@ except RetryBudgetExhaustedError as exc:
128
129
)
129
130
```
130
131
132
+
## `DecodeError`
133
+
134
+
`DecodeError` is raised when `response_model=` is set on a request and the active `ResponseDecoder` failed to parse the response body. The HTTP call itself succeeded — status was 2xx/3xx and the transport delivered the body intact — but the body could not be coerced into the requested model. The exception is raised independently of which decoder is in use (`PydanticDecoder`, `MsgspecDecoder`, or a third-party adapter), so `except httpware.ClientError` is sufficient to cover the response-model decode path.
135
+
136
+
Fields:
137
+
138
+
-`response: httpx2.Response` — the response whose body failed to decode. Status, headers, and the originating `request` are all available via `exc.response.*`.
139
+
-`model: type` — the type that was passed as `response_model=`.
140
+
-`original: BaseException` — the underlying library exception (e.g., `pydantic.ValidationError`, `msgspec.ValidationError`, `msgspec.DecodeError`). Also available via `exc.__cause__`.
141
+
142
+
```python
143
+
from httpware import AsyncClient, DecodeError
144
+
145
+
146
+
try:
147
+
user =await client.get("/users/1", response_model=User)
0 commit comments