Skip to content

Commit f48088f

Browse files
committed
fix: return ErrLinkNotFound when the _link_ isn't found
ipld.ErrNotFound should only be used when the underlying node isn't found
1 parent ea4cf39 commit f48088f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

node.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func (n *ProtoNode) RemoveNodeLink(name string) error {
138138
}
139139

140140
if !found {
141-
return ipld.ErrNotFound
141+
return ErrLinkNotFound
142142
}
143143

144144
n.links = ref

node_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func TestRemoveLink(t *testing.T) {
5959

6060
// should fail
6161
err = nd.RemoveNodeLink("a")
62-
if err != ipld.ErrNotFound {
62+
if err != ErrLinkNotFound {
6363
t.Fatal("should have failed to remove link")
6464
}
6565

0 commit comments

Comments
 (0)