Skip to content

Commit

Permalink
use separate variable for error_info list vs dict
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sanche committed Dec 16, 2024
1 parent 4112847 commit eef3793
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions google/api_core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,14 +517,14 @@ def format_http_response_error(
errors = payload.get("error", {}).get("errors", ())
# In JSON, details are already formatted in developer-friendly way.
details = payload.get("error", {}).get("details", ())
error_info = list(
error_info_list = list(
filter(
lambda detail: detail.get("@type", "")
== "type.googleapis.com/google.rpc.ErrorInfo",
details,
)
)
error_info = error_info[0] if error_info else None
error_info = error_info_list[0] if error_info_list else None
message = _format_rest_error_message(error_message, method, url)

exception = from_http_status(
Expand Down

0 comments on commit eef3793

Please sign in to comment.