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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [0.9.1] - 2026-06-02
9
+
10
+
### Added
11
+
12
+
-**HTTP**: Log translated upstream HTTP errors with structured context, including service, error type, request method, upstream URL, status code, and capped upstream response body details.
13
+
-**Exceptions**: Include upstream status and response body details in `UpstreamRequestException` responses for upstream HTTP 400/422 failures.
14
+
15
+
### Fixed
16
+
17
+
-**HTTP**: Handle `httpx.RequestError` instances without request metadata without raising a secondary exception during upstream error translation.
Copy file name to clipboardExpand all lines: docs/api/exceptions.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,35 @@ Classification:
90
90
- Other upstream HTTP status failures become `UpstreamServiceException`.
91
91
- Other `httpx.RequestError` failures become `UpstreamServiceException`.
92
92
93
+
When an upstream HTTP status error is translated, ZodiacCore logs a warning with structured upstream context:
94
+
95
+
-`upstream_service`
96
+
-`upstream_error_type`
97
+
-`upstream_method` and `upstream_url` when request metadata is available
98
+
-`upstream_status`
99
+
-`upstream_response_body`
100
+
-`upstream_response_body_truncated`
101
+
102
+
The response body logged in `upstream_response_body` is capped at 4096 characters. If the upstream response body has not been read, ZodiacCore logs `"<response body not read>"` instead of consuming the stream. `httpx.RequestError` instances without request metadata are still translated and logged without method or URL fields.
103
+
104
+
For upstream HTTP 400/422 failures, the standard response also includes the upstream status and response body details so callers can diagnose rejected upstream requests:
105
+
106
+
```json
107
+
{
108
+
"code": 400,
109
+
"message": "Upstream request failed",
110
+
"data": {
111
+
"service": "identity_and_access",
112
+
"error_code": "UPSTREAM_REQUEST_ERROR",
113
+
"upstream_status": 422,
114
+
"upstream_response_body": "{\"code\":422}",
115
+
"upstream_response_body_truncated": false
116
+
}
117
+
}
118
+
```
119
+
120
+
For other upstream HTTP status failures, the upstream response body is logged but not returned in the client response.
121
+
93
122
Some upstream services always return HTTP 200 and put business failures in their response body. In that case, parse the upstream payload and raise the ZodiacCore upstream exception yourself:
0 commit comments