1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 01:12:24 +08:00

Merge pull request #4454 from ipfs/fix/get-error-4452

Fix error handling in commands add and get
This commit is contained in:
Whyrusleeping
2017-12-04 18:44:48 +01:00
committed by GitHub
2 changed files with 3 additions and 15 deletions

View File

@ -453,19 +453,8 @@ You can now check what blocks have been created by:
for {
v, err := res.Next()
if err != nil {
// replace error by actual error - will be looked at by next if-statement
if err == cmds.ErrRcvdError {
err = res.Error()
}
if e, ok := err.(*cmdkit.Error); ok {
re.Emit(e)
} else if err != io.EOF {
re.SetError(err, cmdkit.ErrNormal)
}
return
if !cmds.HandleError(err, res, re) {
break
}
select {

View File

@ -109,8 +109,7 @@ may also specify the level of compression by specifying '-l=<1-9>'.
defer re.Close()
v, err := res.Next()
if err != nil {
log.Error(e.New(err))
if !cmds.HandleError(err, res, re) {
return
}