Repository navigation
improve errors - #12
Merged
Merged
Conversation
katlasik
commented
Nov 2, 2025
Owner
- Improve error messages with field names and annotation context
- Add customizable error printer with table format
- Add DecodingContext to pass field name and annotations through decode chain - Update ConfigError types to include field names (Missing, Invalid, Other) - Change error messages to indicate which annotation failed (env var or system property) - Update all ConfigDecoder implementations to accept DecodingContext parameter - Modify ConfigReader.read() to accept field name for better error reporting - Update all tests to reflect new error message format - Add .gitignore entries for CLAUDE.md and .claude directory
- Add ErrorPrinter trait for flexible error formatting - Implement TablePrinter with ASCII box drawing for readable error display - Implement DefaultPrinter maintaining backward compatibility with getMessage - Add print method to ConfigError accepting ErrorPrinter via context parameters - Refactor TablePrinter to use functional style (foldLeft, map, flatMap) - Update ConfigError.invalid to include fieldName parameter for better context - Add comprehensive tests with full message assertions - Document error handling in README with usage examples
katlasik
force-pushed
the
improve_errors
branch
from
November 2, 2025 12:27
be8b3ac to
3d4619e
Compare
- Introduce FieldPath case class to represent hierarchical field paths - Add string interpolator (path"foo.bar") for convenient FieldPath creation - Replace fieldName: String with fieldPath: FieldPath in ConfigError types - Update DecodingContext to use FieldPath instead of String - Thread parent field path through ConfigLoader.load and deriveProduct - Update TablePrinter to display dotted paths (e.g., "dbConfig.host") - Increase TablePrinter column widths for better nested field display - Update all error construction to use FieldPath throughout codebase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.