diff --git a/providers/rpc/http.go b/providers/rpc/http.go index bde373ab..f9c7b3e4 100644 --- a/providers/rpc/http.go +++ b/providers/rpc/http.go @@ -58,8 +58,7 @@ func (p *Provider) handleResponse(statusCode int, headers http.Header, body *byt if statusCode != http.StatusOK { return ResponsePayload{}, fmt.Errorf("unexpected status code: %d, response error(optional): %v", statusCode, res.Error) } - example, _ := json.Marshal(ResponsePayload{ID: 123, Host: p.Host, Error: &ResponseError{Code: 1, Message: "error message"}}) - return ResponsePayload{}, fmt.Errorf("failed to parse response: got: %q, error: %w, expected response json spec: %v", body.String(), err, string(example)) + return ResponsePayload{}, fmt.Errorf("failed to parse response: %w", err) } if statusCode != http.StatusOK { return ResponsePayload{}, fmt.Errorf("unexpected status code: %d, response error(optional): %v", statusCode, res.Error) diff --git a/providers/rpc/rpc_test.go b/providers/rpc/rpc_test.go index 61401324..e15c5ee7 100644 --- a/providers/rpc/rpc_test.go +++ b/providers/rpc/rpc_test.go @@ -124,7 +124,7 @@ func TestPowerStateGet(t *testing.T) { shouldErr bool url string }{ - "success": {}, + "success": {powerState: "on"}, "unknown state": {shouldErr: true}, }