Skip to content

BUG: fmt.Errorf chain '%w: %v' loses original cause in i18n parser #1050

@andrinoff

Description

@andrinoff

Describe the bug

In i18n/parser.go:18:

return nil, fmt.Errorf("%w: %v", ErrParseFailed, err)

Only ErrParseFailed is wrapped — the underlying err is rendered as text and lost from the error chain. errors.Is(returned, originalErr) no longer matches.

Expected behavior

Use %w for both: fmt.Errorf("%w: %w", ErrParseFailed, err) (Go ≥ 1.20) or wrap the original error directly.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

Status

In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions