Commit ef322f3c authored by Jeromy's avatar Jeromy

comment multiple dagstore error checking

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>
parent 7cb580ad
...@@ -98,9 +98,12 @@ func (e *Editor) insertNodeAtPath(ctx context.Context, root *dag.Node, path []st ...@@ -98,9 +98,12 @@ func (e *Editor) insertNodeAtPath(ctx context.Context, root *dag.Node, path []st
nd = create() nd = create()
err = nil // no longer an error case err = nil // no longer an error case
} else if err == dag.ErrNotFound { } else if err == dag.ErrNotFound {
// try finding it in our source dagstore
nd, err = root.GetLinkedNode(ctx, e.src, path[0]) nd, err = root.GetLinkedNode(ctx, e.src, path[0])
} }
// if we receive an ErrNotFound, then our second 'GetLinkedNode' call
// also fails, we want to error out
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -153,6 +156,7 @@ func (e *Editor) rmLink(ctx context.Context, root *dag.Node, path []string) (*da ...@@ -153,6 +156,7 @@ func (e *Editor) rmLink(ctx context.Context, root *dag.Node, path []string) (*da
return root, nil return root, nil
} }
// search for node in both tmp dagstore and source dagstore
nd, err := root.GetLinkedNode(ctx, e.tmp, path[0]) nd, err := root.GetLinkedNode(ctx, e.tmp, path[0])
if err == dag.ErrNotFound { if err == dag.ErrNotFound {
nd, err = root.GetLinkedNode(ctx, e.src, path[0]) nd, err = root.GetLinkedNode(ctx, e.src, path[0])
......
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