Skip to content

Commit

Permalink
Merge pull request #4437 from ipfs/fix/add-abort-panic
Browse files Browse the repository at this point in the history
Fix/add abort panic
  • Loading branch information
whyrusleeping authored Nov 30, 2017
2 parents a81025f + a3a3179 commit d4add99
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/ipfs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,12 @@ func callCommand(ctx context.Context, req cmds.Request, root *cmds.Command, cmd
}

go func() {
err = cmds.Copy(re, res)
err := cmds.Copy(re, res)
if err != nil {
re.SetError(err, cmdkit.ErrNormal|cmdkit.ErrFatal)
err = re.Emit(cmdkit.Error{err.Error(), cmdkit.ErrNormal | cmdkit.ErrFatal})
if err != nil {
log.Error(err)
}
}
}()
} else {
Expand Down

0 comments on commit d4add99

Please sign in to comment.