Skip to content

fix: potential crash on missing config file with unhandled exception#482

Open
zendy199x wants to merge 1 commit intotfeldmann:mainfrom
zendy199x:fix/potential-crash-on-missing-config-file-with-unhand
Open

fix: potential crash on missing config file with unhandled exception#482
zendy199x wants to merge 1 commit intotfeldmann:mainfrom
zendy199x:fix/potential-crash-on-missing-config-file-with-unhand

Conversation

@zendy199x
Copy link
Copy Markdown

@zendy199x zendy199x commented Mar 28, 2026

Change Summary

Fix potential crash on missing config file with unhandled exception. Added proper exception handling around find_config call to catch ConfigNotFound and provide a clear error message to the user before exiting.

Related issue number

Checklist

  • Tests for the changes exist and pass on CI
  • Documentation reflects the changes where applicable
  • Change is documented in CHANGELOG.md (if applicable)
  • My PR is ready to review

Copilot AI review requested due to automatic review settings March 28, 2026 17:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent CLI crashes when a config file can’t be found by adding explicit handling for ConfigNotFound around find_config() calls in the CLI entrypoints.

Changes:

  • Wrapped find_config() in ConfigWithPath.by_name_or_path() with a try/except ConfigNotFound that prints an error and exits.
  • Added similar ConfigNotFound handling to the edit() command.
  • Added similar ConfigNotFound handling to the show() command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread organize/cli.py Outdated
Comment thread organize/cli.py Outdated
Comment thread organize/cli.py Outdated
Comment thread organize/cli.py Outdated
Comment thread organize/cli.py Outdated
Comment thread organize/cli.py Outdated
@zendy199x
Copy link
Copy Markdown
Author

I took another pass at the failing CI checks, but after 1 follow-up attempt(s) these checks are still failing: Cleanup artifacts.

I'm closing this PR for now because the remaining failures look like they need manual investigation before the change can move forward.

@zendy199x zendy199x closed this Mar 28, 2026
@zendy199x zendy199x reopened this Mar 28, 2026
@zendy199x zendy199x force-pushed the fix/potential-crash-on-missing-config-file-with-unhand branch from 07b4646 to 31ab5a2 Compare March 28, 2026 17:26
- update organize/cli.py
- address 1 review comment(s)

Signed-off-by: Zendy <[email protected]>
@zendy199x zendy199x force-pushed the fix/potential-crash-on-missing-config-file-with-unhand branch from 31ab5a2 to edb86ef Compare March 28, 2026 18:27
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.

2 participants