zboxcli
zboxcli copied to clipboard
Fix incorrect error messages
When some operations fail, an incorrect error message is being returned:
Error Adding curator: Error adding curator:alloc_cancel_failed: value not present
Error Creating allocation: Error creating allocation:alloc_cancel_failed: only owner can cancel an allocation
Error renaming file Delete failed: Commit consensus failed
Error moving file Copy failed: Copy request failed. Operation failed.
Error message when not-existent allocation ID is passed.
zbox --wallet wallet2.json --allocation 97f3040ccf62462b2c680325b63a0a2c850fd216fe4ec7694ef4c4ea6f0b9e53 list --remotepath /
--silent
error from server list response: {"code":"invalid_parameters","error":"invalid_parameters: Auth ticket is required"}
Expected error:
error from server list response: invalid allocation ID
upload failure reason not shown properly
details here: https://github.com/0chain/zboxcli/issues/327
➜ ~ zbox createdir --dirname /Images --allocation $alloc
0chain-core-sdk [INFO] 2022/11/22 13:29:47.365484 wallet_base.go:262: ******* Wallet SDK Version:v1.8.8-8-g3c6d3d6c ******* (SetLogFile)
0box-sdk [INFO] 2022/11/22 13:29:47.367814 sdk.go:73: ******* Storage SDK Version: v1.8.8-8-g3c6d3d6c *******
0chain-core-sdk [INFO] 2022/11/22 13:29:47.649117 transaction_base.go:138: ******* Wallet SDK Version:v1.8.8-8-g3c6d3d6c ******* (InitZCNSDK)
0box-sdk [DEBUG] 2022/11/22 13:29:47.865356 networkworker.go:105: Get network result:{"miners":["https://dev.0chain.net/miner03","https://dev.0chain.net/miner02","https://dev.0chain.net/miner01"],"sharders":["https://dev.0chain.net/sharder01","https://dev.0chain.net/sharder02"]}
0box-sdk [INFO] 2022/11/22 13:29:48.028671 dirworker.go:41: Start creating dir for blobbers
0box-sdk [ERROR] 2022/11/22 13:29:48.101682 dirworker.go:212: https://dev.0chain.net/blobber03 Response: {"code":"directory_exists","error":"directory_exists: Directory already exists`"}
0box-sdk [ERROR] 2022/11/22 13:29:48.101742 dirworker.go:212: https://dev.0chain.net/blobber02 Response: {"code":"directory_exists","error":"directory_exists: Directory already exists`"}
/Images directory created
on failure zbox createdir
show directory created.
Getting error downloading the shared file from own wallet to own wallet. The error should be thrown accordingly to the user.