(reply interface{})
| 58 | } |
| 59 | |
| 60 | func (c clientResponse) decode(reply interface{}) error { |
| 61 | if c.Error != nil { |
| 62 | jsonErr := &Error{} |
| 63 | if err := json.Unmarshal(*c.Error, jsonErr); err != nil { |
| 64 | return &Error{ |
| 65 | Code: E_SERVER, |
| 66 | Message: string(*c.Error), |
| 67 | } |
| 68 | } |
| 69 | return jsonErr |
| 70 | } |
| 71 | |
| 72 | if c.Result == nil { |
| 73 | return ErrNullResult |
| 74 | } |
| 75 | |
| 76 | return json.Unmarshal(*c.Result, reply) |
| 77 | } |
| 78 | |
| 79 | // DecodeClientResponse decodes the response body of a client request into |
| 80 | // the interface reply. |
no test coverage detected