unhide error message from jsonRpcSend

This commit is contained in:
AndreasM 2013-06-13 19:16:41 +03:00
parent 4ab8ca5eef
commit 27b69ccca3
2 changed files with 2 additions and 4 deletions

View file

@ -708,7 +708,7 @@ func RpcCommand(user string, password string, server string, message []byte) (Re
} }
resp, err := jsonRpcSend(user, password, server, message) resp, err := jsonRpcSend(user, password, server, message)
if err != nil { if err != nil {
err := fmt.Errorf("Error Sending json message.") err := fmt.Errorf("Error sending json message: "+err.Error())
return result, err return result, err
} }
body, err := GetRaw(resp.Body) body, err := GetRaw(resp.Body)

View file

@ -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) { func jsonRpcSend(user string, password string, server string, message []byte) (*http.Response, error) {
resp, err := http.Post("http://"+user+":"+password+"@"+server, resp, err := http.Post("http://"+user+":"+password+"@"+server,
"application/json", bytes.NewBuffer(message)) "application/json", bytes.NewBuffer(message))
if err != nil {
err = fmt.Errorf("Error Sending json message.")
}
return resp, err return resp, err
} }