From 27b69ccca3819cc9e9f3a45cf5115a03b4866c0a Mon Sep 17 00:00:00 2001 From: AndreasM Date: Thu, 13 Jun 2013 19:16:41 +0300 Subject: [PATCH] unhide error message from jsonRpcSend --- jsonapi.go | 2 +- jsonfxns.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) 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 }