Skip to content

fix(middleware-serde): add response metadata to deserialization errors #1588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2025

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented May 12, 2025

This adds the error.$metadata field to deserialization errors, so that the (earlier in order) retry middleware can decide to retry the error if the response code is retryable, regardless of the format of the error.

This scenario can happen when a server origin response is supposed to be e.g. JSON but its load balancer is XML or does not reach the point of checking the correct response format. If the LB sheds a request with a retryable error code but unparsable body, the parsing error should be treated as non-terminal, retryable.

@kuhe kuhe requested a review from a team as a code owner May 12, 2025 14:36
@kuhe kuhe force-pushed the fix/deser-retry branch from e98e235 to 5dd65ef Compare May 12, 2025 14:40
@kuhe kuhe force-pushed the fix/deser-retry branch from 5dd65ef to 7c20b6a Compare May 12, 2025 14:43
@kuhe kuhe merged commit 103535a into smithy-lang:main May 12, 2025
10 checks passed
@kuhe kuhe deleted the fix/deser-retry branch May 12, 2025 15:41
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.

3 participants