update log library

master
dingjun 3 years ago
parent 103eb1ec6a
commit 26f4d757c9

@ -10,7 +10,7 @@ import (
"net/url" "net/url"
"sync" "sync"
log "github.com/fangdingjun/go-log" log "github.com/fangdingjun/go-log/v5"
) )
// HTTPTransport json rpc over http // HTTPTransport json rpc over http
@ -107,7 +107,7 @@ func (h *HTTPTransport) CallWithHeader(method string, args interface{}, reply in
if err = json.Unmarshal(data, &res); err != nil { if err = json.Unmarshal(data, &res); err != nil {
// non 200 response without valid json response // non 200 response without valid json response
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK {
return fmt.Errorf("http error: %s", resp.Status) return fmt.Errorf("http error: %s, %s", resp.Status, data)
} }
return err return err
} }
@ -119,7 +119,7 @@ func (h *HTTPTransport) CallWithHeader(method string, args interface{}, reply in
// non 200 response without valid json response // non 200 response without valid json response
if res.ID == r.ID && resp.StatusCode != http.StatusOK { if res.ID == r.ID && resp.StatusCode != http.StatusOK {
return fmt.Errorf("http error: %s", resp.Status) return fmt.Errorf("http error: %s, %s", resp.Status, data)
} }
return json.Unmarshal(res.Result, &reply) return json.Unmarshal(res.Result, &reply)

@ -3,7 +3,7 @@ package jsonrpc
import ( import (
"testing" "testing"
log "github.com/fangdingjun/go-log" log "github.com/fangdingjun/go-log/v5"
) )
func TestCall(t *testing.T) { func TestCall(t *testing.T) {

@ -8,7 +8,7 @@ import (
"net/http" "net/http"
"sync" "sync"
log "github.com/fangdingjun/go-log" log "github.com/fangdingjun/go-log/v5"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
) )

Loading…
Cancel
Save