diff --git a/rpc/client.go b/rpc/client.go index 05b87ae96c..4bf092c34b 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -364,7 +364,7 @@ func (c *Client) CallContext(ctx context.Context, result interface{}, method str resp := batchresp[0] switch { case resp.Error != nil: - return resp.Error + return resp.Error.FullError() case len(resp.Result) == 0: return ErrNoResult default: diff --git a/rpc/json.go b/rpc/json.go index e932389d17..15d392a872 100644 --- a/rpc/json.go +++ b/rpc/json.go @@ -157,6 +157,10 @@ func (err *jsonError) ErrorData() interface{} { return err.Data } +func (err *jsonError) FullError() error { + return fmt.Errorf("message: %v, code: %v, data: %v", err.Message, err.Code, err.Data) +} + // Conn is a subset of the methods of net.Conn which are sufficient for ServerCodec. type Conn interface { io.ReadWriteCloser