feat(line_no): Add line number to errors (#1422)

This commit is contained in:
Sergio Garcia
2022-10-20 14:32:35 +02:00
committed by GitHub
parent 44ce95979b
commit 5c78e6b171
5 changed files with 75 additions and 31 deletions

View File

@@ -205,7 +205,9 @@ def run_check(check, audit_info, output_options):
findings = check.execute()
except Exception as error:
print(f"Something went wrong in {check.checkID}, please use --log-level ERROR")
logger.error(f"{check.checkID} -- {error.__class__.__name__}: {error}")
logger.error(
f"{check.checkID} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)
else:
report(findings, output_options, audit_info)
finally: