Commit 3d8b6894 authored by Hector Sanjuan's avatar Hector Sanjuan

Add IsErrNotFound() method

parent 6e38c33b
......@@ -2,6 +2,7 @@ package format
import (
"context"
"errors"
"fmt"
cid "github.com/ipfs/go-cid"
......@@ -41,6 +42,12 @@ func (e ErrNotFound) NotFound() bool {
return true
}
// IsNotFound returns if the given error is or wraps an ErrNotFound
// (equivalent to errors.Is(err, ErrNotFound{}))
func IsNotFound(err error) bool {
return errors.Is(err, ErrNotFound{})
}
// Either a node or an error.
type NodeOption struct {
Node Node
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment