From 26f4d757c933b9420ce898eea62e2fab3276ae20 Mon Sep 17 00:00:00 2001 From: dingjun Date: Wed, 4 Aug 2021 16:40:48 +0800 Subject: [PATCH] update log library --- http_transport.go | 6 +++--- jsonrpc_test.go | 2 +- websocket_transport.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/http_transport.go b/http_transport.go index 37f756c..b83d9c8 100644 --- a/http_transport.go +++ b/http_transport.go @@ -10,7 +10,7 @@ import ( "net/url" "sync" - log "github.com/fangdingjun/go-log" + log "github.com/fangdingjun/go-log/v5" ) // 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 { // non 200 response without valid json response 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 } @@ -119,7 +119,7 @@ func (h *HTTPTransport) CallWithHeader(method string, args interface{}, reply in // non 200 response without valid json response 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) diff --git a/jsonrpc_test.go b/jsonrpc_test.go index 24327e0..724036c 100644 --- a/jsonrpc_test.go +++ b/jsonrpc_test.go @@ -3,7 +3,7 @@ package jsonrpc import ( "testing" - log "github.com/fangdingjun/go-log" + log "github.com/fangdingjun/go-log/v5" ) func TestCall(t *testing.T) { diff --git a/websocket_transport.go b/websocket_transport.go index 3ace1a4..99c4e89 100644 --- a/websocket_transport.go +++ b/websocket_transport.go @@ -8,7 +8,7 @@ import ( "net/http" "sync" - log "github.com/fangdingjun/go-log" + log "github.com/fangdingjun/go-log/v5" "github.com/gorilla/websocket" )