Skip to content

Commit

Permalink
Update daemon.py
Browse files Browse the repository at this point in the history
  • Loading branch information
daisieh committed Nov 20, 2024
1 parent 309ebc7 commit d4a00d1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ def ingest_file(file_path):
json_data = None
results = {}
results_path = os.path.join(DAEMON_PATH, "results", os.path.basename(file_path))
with open(file_path) as f:
json_data = json.load(f)
try:
with open(file_path) as f:
json_data = json.load(f)
except Exception as e:
message = f"Couldn't load data from {file_path}: {type(e)} {str(e)}"
logger.error(message)
results["error"] = message
if json_data is not None:
logger.info(f"Ingesting {file_path}")
if "katsu" in json_data:
Expand Down

0 comments on commit d4a00d1

Please sign in to comment.