diff --git a/jsonapi.go b/jsonapi.go index b2bcaa38..f0f7699e 100644 --- a/jsonapi.go +++ b/jsonapi.go @@ -708,7 +708,7 @@ func RpcCommand(user string, password string, server string, message []byte) (Re } resp, err := jsonRpcSend(user, password, server, message) if err != nil { - err := fmt.Errorf("Error Sending json message.") + err := fmt.Errorf("Error sending json message: "+err.Error()) return result, err } body, err := GetRaw(resp.Body) diff --git a/jsonfxns.go b/jsonfxns.go index 555f612c..56991b2f 100644 --- a/jsonfxns.go +++ b/jsonfxns.go @@ -34,9 +34,7 @@ func MarshallAndSend(rawReply Reply, w io.Writer) (string, error) { func jsonRpcSend(user string, password string, server string, message []byte) (*http.Response, error) { resp, err := http.Post("http://"+user+":"+password+"@"+server, "application/json", bytes.NewBuffer(message)) - if err != nil { - err = fmt.Errorf("Error Sending json message.") - } + return resp, err }