Skip to content

Commit

Permalink
ground_truth: better error handling when logging discarded flows
Browse files Browse the repository at this point in the history
  • Loading branch information
AlyaGomaa committed Nov 5, 2024
1 parent e9641f4 commit 24b2e71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions parsers/ground_truth.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ def extract_fields(self, line: str) -> Tuple[Union[bool,dict], str]:

try:
if flow[0] == "unknown":
return False, f"Unsupported flow label '{flow[0]}'"
label = "background" if "Background" in line else ""
return False, f"Unsupported flow label {label}"

return {
'label': flow[0],
Expand Down Expand Up @@ -396,7 +397,7 @@ def parse_file(self, filename: str):

flow, err = self.extract_fields(line)
if not flow:
self.log(f"{err}. Skipping flow at line",
self.log(f"{err}. Skipping flow at line: ",
line_number,
error=True)
continue
Expand Down

0 comments on commit 24b2e71

Please sign in to comment.