Skip to content

Commit

Permalink
[gcp][fix] Improve error message (#2161)
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias authored Aug 6, 2024
1 parent 89ffc7c commit dcd08d9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions plugins/gcp/fix_plugin_gcp/resources/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,19 +651,18 @@ def __exit__(
except Exception as ex:
errors = {f"ParseError:unknown:{ex}"}
pass
error_summary = ", ".join(errors)
error_summary = " Error Codes: " + (", ".join(errors)) if errors else ""

if errors and errors.issubset(self.expected_errors):
log.info(
f"Expected Exception while collecting{self.extra_info} ({exc_type.__name__}): "
f"{error_details} Error Codes: {error_summary}. Ignore."
f"{error_details}{error_summary}. Ignore."
)
return True

if not Config.gcp.discard_account_on_resource_error:
self.core_feedback.error(
f"Error while collecting{self.extra_info} ({exc_type.__name__}): "
f"{error_details} Error Codes: {error_summary}",
f"Error while collecting{self.extra_info} ({exc_type.__name__}): " f"{error_details}{error_summary}",
log,
)
return True
Expand Down

0 comments on commit dcd08d9

Please sign in to comment.