Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dydysy committed Mar 14, 2018
1 parent 1b71df4 commit 885990d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ func handleError(err error, r *rpcResponse) error {
if err != nil {
return err
}
if r.Err != nil {
rr := r.Err.(map[string]interface{})
return errors.New(fmt.Sprintf("(%v) %s", rr["code"].(float64), rr["message"].(string)))

if r.Err.Message != "" {
rr := r.Err
return errors.New(fmt.Sprintf("(%v) %s", rr.Code, rr.Message))

}
//if r.Err != nil {
// rr := r.Err.(map[string]interface{})
// return errors.New(fmt.Sprintf("(%v) %s", rr["code"].(float64), rr["message"].(string)))
//}
return nil
}

0 comments on commit 885990d

Please sign in to comment.