Skip to content

Commit

Permalink
Add error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ApsiV11 committed Jan 20, 2025
1 parent ed51832 commit 1798380
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion data_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def get_weekly_data(year, week_number, base_url=weekly_base_url_old):
else:
with open(url, "r+", encoding="utf8", newline="\n") as f:
return json.loads(f.read())
except JSONDecodeError:
except JSONDecodeError: # OLD REMOVE LATER
data = {} # OLD REMOVE LATER
except FileNotFoundError:
data = {}
return data

Expand Down

0 comments on commit 1798380

Please sign in to comment.