Skip to content

Commit da45ba3

Browse files
committed
results: print warning for recoverable errors
... to make it obvious in `scan.log` that they did not affect the overall exit code. Closes: #148
1 parent 509e087 commit da45ba3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

py/common/results.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ def update_ec(self, ec):
181181
self.ec = ec
182182

183183
def error(self, msg, ec=1, err_prefix=""):
184-
self.print_with_ts("%serror: %s\n" % (err_prefix, msg), prefix="!!! ")
184+
level = "warning" if ec == 0 else "error"
185+
self.print_with_ts(f"{err_prefix}{level}: {msg}\n", prefix="!!! ")
185186
self.update_ec(ec)
186187
if not self.dying and not self.keep_going and (self.ec != 0):
187188
raise FatalError(ec)

0 commit comments

Comments
 (0)