Skip to content

bug: show a clear error when tasks.json is invalid #3

Description

@MrParamecium

Problem

The task tracker crashes with a Python traceback when tasks.json contains invalid JSON.

Steps to reproduce

  1. Replace the contents of tasks.json with invalid JSON:

    [
      {"title": "Broken task"
  2. 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

  • list, add, and complete handle invalid JSON consistently
  • no Python traceback is displayed
  • the original tasks.json remains unchanged
  • automated tests cover invalid JSON

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions