Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3109b59

Browse files
committedNov 23, 2015
Simplify context canceled err message
License: MIT Signed-off-by: rht <rhtbot@gmail.com>
1 parent 54604c9 commit 3109b59

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎cmd/ipfs/main.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ func callCommand(ctx context.Context, req cmds.Request, root *cmds.Command, cmd
328328
if isConnRefused(err) {
329329
err = repo.ErrApiNotRunning
330330
}
331-
return nil, err
331+
return nil, wrapContextCanceled(err)
332332
}
333333

334334
} else {
@@ -685,3 +685,10 @@ func isConnRefused(err error) bool {
685685

686686
return netoperr.Op == "dial"
687687
}
688+
689+
func wrapContextCanceled(err error) error {
690+
if strings.Contains(err.Error(), "request canceled") {
691+
err = errors.New("request canceled")
692+
}
693+
return err
694+
}

0 commit comments

Comments
 (0)
Please sign in to comment.