Skip to content

remove dependency https://github.com/pkg/errors #23

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

Open
vlappa opened this issue Sep 15, 2023 · 5 comments
Open

remove dependency https://github.com/pkg/errors #23

vlappa opened this issue Sep 15, 2023 · 5 comments

Comments

@vlappa
Copy link

vlappa commented Sep 15, 2023

Handle errors as discussed here:
https://go.dev/blog/go1.13-errors

@mitar
Copy link

mitar commented Oct 8, 2023

Shameless plug: you can also switch it to drop-in replacement gitlab.com/tozd/go/errors. It fixes many issues, is maintained, and supports modern Go's error patterns (sentinel errors, %w formating, joined errors, etc.).

@vlappa
Copy link
Author

vlappa commented Oct 8, 2023

My preference would be to avoid external libraries which are not part of the standard library as much as possible.

@mitar
Copy link

mitar commented Oct 8, 2023

That is hard to do if you want stack traces with errors, for example. But otherwise yes, standard errors package now is pretty useful on its own as well.

@vlappa
Copy link
Author

vlappa commented Oct 12, 2023

When this library reports a error, you don't clearly see that the reported error is coming from this library. I wonder how other libraries handle it, or whether there is a convention for it.

For example, now we get "invalid OSC address", what if it had a keyword like "osc: invalid OSC address".

@mitar
Copy link

mitar commented Oct 12, 2023

The library should probably export sentinel errors so that callers can use errors.Is or errors.As to determine where the error is coming from.

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

No branches or pull requests

2 participants