Skip to content

fix(errors): guard APIError._get_code on non-dict response bodies - #3475

Open
Roxen-AS wants to merge 1 commit into
googleapis:mainfrom
Roxen-AS:fix/api-error-non-dict-code
Open

Roxen-AS wants to merge 1 commit into
googleapis:mainfrom
Roxen-AS:fix/api-error-non-dict-code

Conversation

@Roxen-AS

@Roxen-AS Roxen-AS commented Dec 5, 2026

Copy link
Copy Markdown

Guarded APIError._get_code against non-dict response bodies (such as websocket close reasons, integers, or multi-entry list payloads) and non-dict 'error' fields so constructing APIError with a falsy code returns code=None instead of raising AttributeError, matching _get_status and _get_message.

Fixes #3472

Signed-off-by: Roxen-AS <akash.arjun12@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant