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

Redo error-formatting utilities to be a bit more idiomatic #118

Open
benjaminjkraft opened this issue Sep 28, 2021 · 1 comment
Open

Redo error-formatting utilities to be a bit more idiomatic #118

benjaminjkraft opened this issue Sep 28, 2021 · 1 comment
Labels
good first issue Good for newcomers help wanted Issues that anyone could pick up and implement if useful to them internal

Comments

@benjaminjkraft
Copy link
Collaborator

benjaminjkraft commented Sep 28, 2021

We have our own errorf (in generate/errors.go) so that we can do structured errors with positions. But our errorf is a bit un-idiomatic (which caused confusion in #117) -- it just wraps the first error argument it finds rather than using %w -- and it also doesn't actually format wrapped errors in a very good way (e.g. here). We could probably do better, either having our wrapper do an ordinary fmt.Errorf (by formatting the position at call-time), or by making it a bit more idiomatic and using its extra structure to hoist the position to the outermost error.

@benjaminjkraft benjaminjkraft added good first issue Good for newcomers help wanted Issues that anyone could pick up and implement if useful to them internal labels Sep 28, 2021
@benjaminjkraft
Copy link
Collaborator Author

benjaminjkraft commented Nov 21, 2022

Would also be nice to add a details/URL field, see #239, and use that more consistently.

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 Issues that anyone could pick up and implement if useful to them internal
Projects
None yet
Development

No branches or pull requests

1 participant