Skip to content

Commit

Permalink
feat: use new more clearer format in ErrNotFound
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorropo committed Apr 2, 2022
1 parent 2e5400e commit a04e884
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions merkledag.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package format
import (
"context"
"errors"
"fmt"

cid "github.com/ipfs/go-cid"
)
Expand All @@ -21,10 +20,10 @@ type ErrNotFound struct {
// message for this error.
func (e ErrNotFound) Error() string {
if e.Cid == cid.Undef {
return "node not found"
return "ipld: could not find node"
}

return fmt.Sprintf("%s not found", e.Cid)
return "ipld: could not find " + e.Cid.String()
}

// Is allows to check whether any error is of this ErrNotFound type.
Expand Down

0 comments on commit a04e884

Please sign in to comment.