Skip to content

Commit

Permalink
Produce an understanable error
Browse files Browse the repository at this point in the history
when a collection of remediation goes wrong -
at least name the rule and the remediation type.
  • Loading branch information
matejak committed Jan 6, 2023
1 parent 7ed780c commit a0543e6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build-scripts/collect_remediations.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,14 @@ def collect_remediations(
if fix_path is None:
# neither static nor templated remediation found
continue
process_remediation(
rule, fix_path, lang, output_dirs, expected_file_name, env_yaml, cpe_platforms)
try:
process_remediation(
rule, fix_path, lang, output_dirs, expected_file_name, env_yaml, cpe_platforms)
except Exception as exc:
msg = (
"Failed to dispatch {lang} remediation for {rule_id}: {error}"
.format(lang=lang, rule_id=rule.id_, error=str(exc)))
raise RuntimeError(msg)


def main():
Expand Down

0 comments on commit a0543e6

Please sign in to comment.