Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions rpcClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ type rpcRequest struct {
JsonRpc string `json:"jsonrpc"`
}

// rpcError represents a RCP error
/*type rpcError struct {
Code int16 `json:"code"`
Message string `json:"message"`
}*/

type rpcResponse struct {
Id int64 `json:"id"`
Result json.RawMessage `json:"result"`
Expand Down Expand Up @@ -109,12 +103,11 @@ func (c *rpcClient) call(method string, params interface{}) (rr rpcResponse, err
defer resp.Body.Close()

data, err := ioutil.ReadAll(resp.Body)
//fmt.Println(string(data))
if err != nil {
return
}
if resp.StatusCode != 200 {
err = errors.New("HTTP error: " + resp.Status)
err = errors.New("HTTP error: " + string(data))
return
}
err = json.Unmarshal(data, &rr)
Expand Down