Skip to content

Commit

Permalink
results: print warning for recoverable errors
Browse files Browse the repository at this point in the history
... to make it obvious in `scan.log` that they did not affect
the overall exit code.

Closes: #148
  • Loading branch information
kdudka committed Jan 5, 2024
1 parent 509e087 commit da45ba3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion py/common/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ def update_ec(self, ec):
self.ec = ec

def error(self, msg, ec=1, err_prefix=""):
self.print_with_ts("%serror: %s\n" % (err_prefix, msg), prefix="!!! ")
level = "warning" if ec == 0 else "error"
self.print_with_ts(f"{err_prefix}{level}: {msg}\n", prefix="!!! ")
self.update_ec(ec)
if not self.dying and not self.keep_going and (self.ec != 0):
raise FatalError(ec)
Expand Down

0 comments on commit da45ba3

Please sign in to comment.