Skip to content

Commit

Permalink
Handle generic errors
Browse files Browse the repository at this point in the history
  • Loading branch information
surge119 committed Aug 9, 2024
1 parent 0229727 commit eacf85d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/fixit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,13 @@ def collect_rules(
named_enables |= rules
all_rules |= rules
except CollectionError as e:
log.warning(f"Failed to collect enabled rules for {config.enable}: {e}")
log.warning(
f"Collection Error: Failed to collect enabled rules for {config.enable}: {e}"
)
except Exception as e:
log.warning(
f"Failed to collect enabled rules for {config.enable}: {e.__class__.__name__}: {e}"
)

for qualified_rule in config.disable:
try:
Expand All @@ -246,7 +252,11 @@ def collect_rules(
all_rules -= set(disabled_rules)
except CollectionError as e:
log.warning(
f"Failed to collect disabled rules for {config.enable}: {e}"
f"Collection Error: Failed to collect disabled rules for {config.enable}: {e}"
)
except Exception as e:
log.warning(
f"Failed to collect disabled rules for {config.enable}: {e.__class__.__name__}: {e}"
)

if config.tags:
Expand Down

0 comments on commit eacf85d

Please sign in to comment.