Add method returns a list on adding one file
See original GitHub issueAdding one file user expects dict-type return (unfolded from original list-type response by stream decorer), but if ipfs provider proceed request with error (even it’s not critical) he got a list like its shown below.
>>> ipfsapi.connect('http://127.0.0.1', 5001).add('./myfile')
[{'Name': 'myfile', 'Hash': 'QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH', 'Size': '6'},
{'Message': 'cannot store pin state: write /var/lib/ipfs/datastore/000014.log: no space left on device', 'Code': 0, 'Type': 'error'}]
If user adding a directory he also get a list longer than expected.
>>> ipfsapi.connect('http://127.0.0.1', 5001).add('./mydir')
[{'Name': 'mydir/myfile2', 'Hash': 'QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH', 'Size': '6'},
{'Name': 'mydir/myfile1', 'Hash': 'QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH', 'Size': '6'},
{'Name': 'mydir', 'Hash': 'Qmaqk3vCjaXMJf6HqeV7aTRvHZpELsJNRWU7WgFJ4Z9M9X', 'Size': '114'},
{'Message': 'cannot store pin state: write /var/lib/ipfs/datastore/000014.log: no space left on device', 'Code': 0, 'Type': 'error'}]
Maybe there is a better place for error messages to let add
return expected type / size?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Adding items from a different file and storing them in another ...
In ArrayList, you need to call get method with index of object that you want access. Instead of ProductList(i) in getProduct method, ...
Read more >Python's .append(): Add Items to Your Lists in Place
In this step-by-step tutorial, you'll learn how Python's .append() works and how to use it for adding items to your list in place....
Read more >Set add() method in Java with Examples - GeeksforGeeks
The add() method of Set in Java is used to add a specific element into a Set collection. The function adds the element...
Read more >How To add Elements to a List in Python - DigitalOcean
There are four methods to add elements to a List in Python. ... This function adds a single element to the end of...
Read more >Append in Python – How to Append to a List or an Array
The .append() method adds an additional element to the end of an already existing list. The general syntax looks something like this: list_name ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed by the exception handling part in #166 and making the number of return values explicitly defined in #167
Thank you! I cannot formally assign this to you on GitHub atm, but definitely fell free to work on this.