Skip to content

Commit

Permalink
ignore broad exception catch
Browse files Browse the repository at this point in the history
It's necessary to let the import continue with the rest of the files in case an unexpected exception occurs. We log what happens.
  • Loading branch information
jarno-knaw committed Jul 23, 2024
1 parent f4bdfe0 commit df9c7b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/import/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ def process_bulk(filenames):
for filename in filenames:
try:
articles.append(Article.from_file(filename))
# pylint: disable=broad-exception-caught
except Exception as e:
# pylint: enable=broad-exception-caught
print(f"Failed to parse file '{filename}'")
print(e)

Expand Down

0 comments on commit df9c7b2

Please sign in to comment.