Merge pull request #5166 from schomatis/fix/commands/ls-error-unixfs

core/commands/ls: wrap `NewDirectoryFromNode` error
This commit is contained in:
Steven Allen 2018-08-28 20:46:07 +00:00 committed by GitHub
commit 2362c6d3d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,7 +112,7 @@ The JSON output contains type information.
for i, dagnode := range dagnodes {
dir, err := uio.NewDirectoryFromNode(nd.DAG, dagnode)
if err != nil && err != uio.ErrNotADir {
res.SetError(err, cmdkit.ErrNormal)
res.SetError(fmt.Errorf("the data in %s (at %q) is not a UnixFS directory: %s", dagnode.Cid(), paths[i], err), cmdkit.ErrNormal)
return
}