From 6895fc653fb5f74efd2e7b846213aa122638d0fc Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 23 Mar 2018 16:03:02 -0700 Subject: [PATCH] return a nice error when listing sharded directories Unfortunately, fixing this would require breaking the API. License: MIT Signed-off-by: Steven Allen --- core/commands/unixfs/ls.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/commands/unixfs/ls.go b/core/commands/unixfs/ls.go index 9cf05f610..0c989a2f8 100644 --- a/core/commands/unixfs/ls.go +++ b/core/commands/unixfs/ls.go @@ -137,6 +137,10 @@ possible, please use 'ipfs ls' instead. switch t { case unixfspb.Data_File: break + case unixfspb.Data_HAMTShard: + // We need a streaming ls API for this. + res.SetError(fmt.Errorf("cannot list large directories yet"), cmdkit.ErrNormal) + return case unixfspb.Data_Directory: links := make([]LsLink, len(merkleNode.Links())) output.Objects[hash].Links = links