Skip to content

Refactor errors - #3

Merged
h-dav merged 2 commits into
mainfrom
refactor-errors
May 3, 2026
Merged

Refactor errors#3
h-dav merged 2 commits into
mainfrom
refactor-errors

Conversation

@h-dav

@h-dav h-dav commented May 3, 2026

Copy link
Copy Markdown
Owner

No description provided.

h-dav added 2 commits May 3, 2026 13:46
…n errors

Remove the FieldError wrapper type that was creating redundant wrapping of errors
that already contained field context. Instead, thread fieldName through the decode
chain so each error type is self-contained with complete context (struct field
name + type info + underlying cause), following the os.PathError pattern.

Key changes:
- Remove FieldError struct and all wrapping in populate.go
- Add fieldName to entry struct and thread it through handleField and decode functions
- Add Filepath field to OpenFileError for consistency with FileReadError
- Add FieldName field to UnsupportedFieldTypeError
- Simplify MalformedTagError and MalformedDefaultError Unwrap() methods
- Update error message formatting to use %q for identifiers (field names)
- Move ErrSyntax into the sentinel vars block
- Update all error tests and error message expectations
@h-dav
h-dav merged commit 62c4abd into main May 3, 2026
4 checks passed
@h-dav
h-dav deleted the refactor-errors branch May 3, 2026 12:53
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.

1 participant