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

Smarter ErrNotFound #5344

Open
whyrusleeping opened this issue Aug 5, 2018 · 1 comment
Open

Smarter ErrNotFound #5344

whyrusleeping opened this issue Aug 5, 2018 · 1 comment

Comments

@whyrusleeping
Copy link
Member

We should switch all of our 'not found' style errors over to the go style of having typed errors. Where every 'not found' error has a NotFound() bool method on it, so that it can be type checked easily. This will fix tons of fragile if err == bstore.ErrNotFound type calls.

The main question here is whether or not to add a IsNotFoundErr(err) bool method in some help package, or reimplement as needed (its a one-liner). One thought I had here was that we could put this in our own custom errors package, (a wrapper around the pkg/errors package) and have that be used everywhere.

@Stebalien
Copy link
Member

Having a common error package would be really nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

3 participants