Skip to content

fix(protocols): handle missing error.Error in queryCompat mode #7758

Merged
kuhe merged 2 commits intomainfrom
fix/protocol-lib-query-compat-crash-7756
Feb 20, 2026
Merged

fix(protocols): handle missing error.Error in queryCompat mode #7758
kuhe merged 2 commits intomainfrom
fix/protocol-lib-query-compat-crash-7756

Conversation

@kuhe
Copy link
Contributor

@kuhe kuhe commented Feb 20, 2026

see original description in #7757

abhu85 and others added 2 commits February 20, 2026 08:46
When an awsQueryCompatible client (e.g. CloudWatchClient) receives an error
response without the x-amzn-query-error header, the decorateServiceException
method would throw:

    TypeError: Cannot read properties of undefined (reading 'Type')

This happens because error.Error is only set by setQueryCompatError() when the
x-amzn-query-error header is present. If the header is absent (e.g., due to a
proxy not forwarding the x-amzn-query-mode request header), error.Error is
undefined.

This fix adds optional chaining to gracefully handle the case where error.Error
is undefined, allowing the error to degrade gracefully instead of crashing.

Fixes #7756

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kuhe kuhe merged commit 15a27f9 into main Feb 20, 2026
7 checks passed
@kuhe kuhe deleted the fix/protocol-lib-query-compat-crash-7756 branch February 20, 2026 21:05
@github-actions
Copy link

github-actions bot commented Mar 7, 2026

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants