Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More cleverly split up glued error messages #24

Closed
Southclaws opened this issue Nov 30, 2022 · 0 comments
Closed

More cleverly split up glued error messages #24

Southclaws opened this issue Nov 30, 2022 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Southclaws
Copy link
Owner

Currently, if you use a library that outputs wrapped errors, you end up with duplicates.

For example:

image

Results in:

errorf wrapped: stdlib sentinel error: stdlib sentinel error

The stdlib sentinel error part is duplicated, which is just noise when trying to read errors.

Solution? Not sure what the best course of action is, but it seems fairly simple to just use the next error message to de-duplicate/split the current.

For example, given:

[1] errorf wrapped: stdlib sentinel error
[2] stdlib sentinel error

When processing [1], look ahead to [2] and remove [2]'s nested message from [1], so we're left with:

[1] errorf wrapped
[2] stdlib sentinel error

@Southclaws Southclaws added help wanted Extra attention is needed good first issue Good for newcomers labels Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant