Problem
The task tracker crashes with a Python traceback when tasks.json contains invalid JSON.
Steps to reproduce
-
Replace the contents of tasks.json with invalid JSON:
[
{"title": "Broken task"
-
Run:
python3 task_tracker.py list
Actual behavior
The program crashes and displays a Python JSONDecodeError traceback.
Expected behavior
The program should display a clear error message:
tasks.json contains invalid JSON
It should exit without modifying or replacing the original file.
Acceptance criteria
Problem
The task tracker crashes with a Python traceback when
tasks.jsoncontains invalid JSON.Steps to reproduce
Replace the contents of
tasks.jsonwith invalid JSON:[ {"title": "Broken task"Run:
Actual behavior
The program crashes and displays a Python
JSONDecodeErrortraceback.Expected behavior
The program should display a clear error message:
It should exit without modifying or replacing the original file.
Acceptance criteria
list,add, andcompletehandle invalid JSON consistentlytasks.jsonremains unchanged