core/commands/ls: wrap `NewDirectoryFromNode` error
License: MIT Signed-off-by: Lucas Molas <schomatis@gmail.com>
Lucas Molas committed
Jul 9, 2018 at 12:37 UTC
ec61606378f29121149276205fe890c4befa9279
1 file changed
+1
-1
core/commands/ls.go
+1
-1
@@ -112,7 +112,7 @@ The JSON output contains type information.
112
for i, dagnode := range dagnodes {
113
dir, err := uio.NewDirectoryFromNode(nd.DAG, dagnode)
114
if err != nil && err != uio.ErrNotADir {
115
- res.SetError(err, cmdkit.ErrNormal)
115
+ res.SetError(fmt.Errorf("the data in %s (at %q) is not a UnixFS directory: %s", dagnode.Cid(), paths[i], err), cmdkit.ErrNormal)
116
return
117
}
118