ipfs / ipfs/kubo

Smarter ErrNotFound

Open
#5,344 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.