Skip to content

Fix Guzzle regression: Error log was truncated / http exception not caught#1963

Open
johanib wants to merge 1 commit intomainfrom
feature/fix-guzzle-regression
Open

Fix Guzzle regression: Error log was truncated / http exception not caught#1963
johanib wants to merge 1 commit intomainfrom
feature/fix-guzzle-regression

Conversation

@johanib
Copy link
Copy Markdown
Contributor

@johanib johanib commented Apr 2, 2026

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 CRITICALlevel 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.

…aught

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants