Skip to content

Fix: Handle missing config file gracefully#17

Open
XiyaoWang0519 wants to merge 1 commit intoApexOpsStudio:mainfrom
XiyaoWang0519:fix/missing-config-handling
Open

Fix: Handle missing config file gracefully#17
XiyaoWang0519 wants to merge 1 commit intoApexOpsStudio:mainfrom
XiyaoWang0519:fix/missing-config-handling

Conversation

@XiyaoWang0519
Copy link

Summary

Fixes the issue where the app crashes with an ugly stack trace when ~/.config/task-cli/config.yaml is missing.

Changes

  • load_config() now checks if config file exists before trying to open it
  • If config file doesn't exist, creates a default config file automatically
  • Added call to load_config() in main() to ensure config is loaded on startup
  • No longer crashes with FileNotFoundError

Testing

  • Tested manually by removing config file and running python3 task.py list
  • Config file is now created automatically with sensible defaults
  • All existing tests pass

Fixes #2

- Create default config file if it doesn't exist
- Load config on startup to ensure it's available
- No longer crashes with FileNotFoundError

Fixes issue: Fix: Crash when config file missing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: Crash when config file missing

1 participant