Skip to content

Commit

Permalink
fix: return ErrLinkNotFound when the _link_ isn't found
Browse files Browse the repository at this point in the history
ipld.ErrNotFound should only be used when the underlying node isn't found
  • Loading branch information
Stebalien committed Jul 26, 2019
1 parent ea4cf39 commit f48088f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion node.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (n *ProtoNode) RemoveNodeLink(name string) error {
}

if !found {
return ipld.ErrNotFound
return ErrLinkNotFound
}

n.links = ref
Expand Down
2 changes: 1 addition & 1 deletion node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestRemoveLink(t *testing.T) {

// should fail
err = nd.RemoveNodeLink("a")
if err != ipld.ErrNotFound {
if err != ErrLinkNotFound {
t.Fatal("should have failed to remove link")
}

Expand Down

0 comments on commit f48088f

Please sign in to comment.