Skip to content

Conversation

@neilhuang007
Copy link

  • Use default values when config options are missing instead of throwing
  • Regenerate config automatically when options are missing or malformed
  • Add TRUNCATE_EXISTING to prevent leftover data from corrupting config
  • Remove System.exit(1) on config parse errors to allow recovery

Fixes #115

- Use default values when config options are missing instead of throwing
- Regenerate config automatically when options are missing or malformed
- Add TRUNCATE_EXISTING to prevent leftover data from corrupting config
- Remove System.exit(1) on config parse errors to allow recovery

Fixes imthosea#115
Copilot AI review requested due to automatic review settings December 25, 2025 00:31
Copy link

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 addresses issue #115 where corrupted config files would cause the application to crash on startup. The fix takes a graceful recovery approach by using default values for missing or corrupted config options and automatically regenerating the config file.

Key changes:

  • Config load errors now trigger regeneration with defaults instead of crashing the application
  • Missing config options are detected and trigger automatic config regeneration
  • TRUNCATE_EXISTING flag prevents leftover data from corrupting config files during writes

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ConfigLoadContext.java Removed System.exit(1) on config parse errors, added hasMissingOptions tracking, and changed missing option handling from throwing exceptions to logging warnings and using defaults
Config.java Added hasMissingOptions condition to trigger config regeneration and added TRUNCATE_EXISTING flag to prevent write corruption

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

@imthosea imthosea closed this Dec 28, 2025
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