Skip to content

fix: Handle missing config file gracefully#26

Open
sofia-willow wants to merge 1 commit intoApexOpsStudio:mainfrom
sofia-willow:fix/config-crash
Open

fix: Handle missing config file gracefully#26
sofia-willow wants to merge 1 commit intoApexOpsStudio:mainfrom
sofia-willow:fix/config-crash

Conversation

@sofia-willow
Copy link

Summary

Fixes the crash when config file is missing (#2).

Problem

load_config() called open() on ~/.config/task-cli/config.yaml without checking if the file exists, causing FileNotFoundError.

Fix

  • Check config_path.exists() before opening
  • Return empty dict as default when file is missing
  • Catch OSError/PermissionError with a warning on stderr
  • CLI works normally without any config file

Closes #2

The load_config() function crashed with FileNotFoundError when the
config file didn't exist at ~/.config/task-cli/config.yaml.

Changes:
- Check if config file exists before attempting to open it
- Return empty dict as default when file is missing
- Catch OSError/PermissionError and warn on stderr
- CLI continues to work without a config file

Closes ApexOpsStudio#2
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