1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 11:31:54 +08:00

return a nice error when listing sharded directories

Unfortunately, fixing this would require breaking the API.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
Steven Allen
2018-03-23 16:03:02 -07:00
parent dd94858981
commit 6895fc653f

View File

@ -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