Skip to content

Add error handling for invalid or missing YAML config#11

Merged
pixelate merged 2 commits into
mainfrom
claude/handle-invalid-yaml-config-ZLLkU
Mar 14, 2026
Merged

Add error handling for invalid or missing YAML config#11
pixelate merged 2 commits into
mainfrom
claude/handle-invalid-yaml-config-ZLLkU

Conversation

@pixelate
Copy link
Copy Markdown
Owner

@pixelate pixelate commented Mar 14, 2026

  • Introduce ConfigError for all config-related failures
  • Config.load now rescues Errno::ENOENT (missing file) and Psych::SyntaxError (malformed YAML) with friendly messages
  • Config.new validates: root must be a Hash, no unsupported top-level keys, required keys present, correct types for library and devices
  • Each device entry is validated for unsupported keys, required fields, and string types
  • CLI wraps Config.load in a helper that rescues ConfigError and exits with a clear message
  • Add 22 tests covering all error paths and valid config loading

claude added 2 commits March 14, 2026 06:51
- Introduce ConfigError for all config-related failures
- Config.load now rescues Errno::ENOENT (missing file) and Psych::SyntaxError (malformed YAML) with friendly messages
- Config.new validates: root must be a Hash, no unsupported top-level keys, required keys present, correct types for library and devices
- Each device entry is validated for unsupported keys, required fields, and string types
- CLI wraps Config.load in a helper that rescues ConfigError and exits with a clear message
- Add 22 tests covering all error paths and valid config loading

https://claude.ai/code/session_01E5tVtnZjoqJkERUVTVKaTf
@pixelate pixelate merged commit 1d9b208 into main Mar 14, 2026
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