Commit e2f6c3a
committed
Fix Guzzle regression: Error log was truncated / http exception not caught
Guzzle 7 renamed the option that disables automatic exception throwing for
4xx/5xx responses from 'exceptions' to 'http_errors'.
The old key was silently ignored, leaving Guzzle's httpErrors middleware active.
This caused GuzzleHttp\Exception\ClientException to be thrown for any non-2xx response instead of returning the response object for the caller to inspect.
In practice this meant that a 400 Bad Request from the attribute aggregation
API (AA) was never caught by AttributeAggregator's HttpException handler and
propagated as an uncaught CRITICAL-level exception. The exception message
was truncated in the logs because Guzzle's BodySummarizer only includes the
first 120 characters of the response body when building the ClientException
message string.1 parent ab8a073 commit e2f6c3a
2 files changed
Lines changed: 36 additions & 2 deletions
File tree
- src/OpenConext/EngineBlock/Http
- tests/unit/OpenConext/EngineBlock/Http
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
199 | 233 | | |
0 commit comments