Skip to content

Commit

Permalink
handle both cmdkit.Error and *cmdkit.Error in ChanResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Feb 16, 2018
1 parent 1114463 commit 679fd7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chan.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ func (r *chanResponse) Next() (interface{}, error) {
return nil, io.EOF
}

if err, ok := v.(cmdkit.Error); ok {
v = &err
}

switch val := v.(type) {
case *cmdkit.Error:
r.err = val
Expand Down

0 comments on commit 679fd7c

Please sign in to comment.