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

routeSubscribeAt should wrap the error it returns #920

Open
maxatome opened this issue Oct 11, 2023 · 0 comments
Open

routeSubscribeAt should wrap the error it returns #920

maxatome opened this issue Oct 11, 2023 · 0 comments

Comments

@maxatome
Copy link
Contributor

maxatome commented Oct 11, 2023

routeSubscribeAt returns 3 kinds of errors. 2 of them are encapsulated with fmt.Errorf.

To facilitate the caller life it could be cool to use %w verb instead of %v in fmt.Errorf call.

This way the caller can, for example, easily check for ENOBUFS error:

if errors.Is(err, syscall.ENOBUFS) {

but this needs go1.13.

As this repo requires 1.12, this means we have to change this requirement to 1.13 (to avoid doing horrible things with build tags, as go1.12 is now more than 3 years old and no longer maintained by the go team.)

Is this change a no-go or do you accept a PR?

Note that v1.1.0 does not encapsulate routeSubscribeAt error with fmt.Errorf, so errors.Is(err, syscall.ENOBUFS) works fine.

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

1 participant