Skip to content

Commit dcd08d9

Browse files
authored
[gcp][fix] Improve error message (#2161)
1 parent 89ffc7c commit dcd08d9

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • plugins/gcp/fix_plugin_gcp/resources

plugins/gcp/fix_plugin_gcp/resources/base.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,19 +651,18 @@ def __exit__(
651651
except Exception as ex:
652652
errors = {f"ParseError:unknown:{ex}"}
653653
pass
654-
error_summary = ", ".join(errors)
654+
error_summary = " Error Codes: " + (", ".join(errors)) if errors else ""
655655

656656
if errors and errors.issubset(self.expected_errors):
657657
log.info(
658658
f"Expected Exception while collecting{self.extra_info} ({exc_type.__name__}): "
659-
f"{error_details} Error Codes: {error_summary}. Ignore."
659+
f"{error_details}{error_summary}. Ignore."
660660
)
661661
return True
662662

663663
if not Config.gcp.discard_account_on_resource_error:
664664
self.core_feedback.error(
665-
f"Error while collecting{self.extra_info} ({exc_type.__name__}): "
666-
f"{error_details} Error Codes: {error_summary}",
665+
f"Error while collecting{self.extra_info} ({exc_type.__name__}): " f"{error_details}{error_summary}",
667666
log,
668667
)
669668
return True

0 commit comments

Comments
 (0)