Skip to content

Commit

Permalink
Added check for empty compendium file.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav committed Aug 24, 2024
1 parent fbd36a6 commit bd86fcd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions node_normalizer/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,9 @@ async def load_compendium(self, compendium_filename: str, block_size: int) -> bo

logger.info(f"{line_counter} {compendium_filename} total lines processed")

if line_counter == 0:
raise RuntimeError(f"Compendium file {compendium_filename} is empty.")

print(f"Done loading {compendium_filename}...")
except Exception as e:
logger.error(f"Exception thrown in load_compendium({compendium_filename}), line {line_counter}: {e}")
Expand Down

0 comments on commit bd86fcd

Please sign in to comment.