From 0d5c23d7ea4364be7ddf237ce36bf0d1f15dda1b Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Wed, 20 Mar 2024 20:52:25 +0100 Subject: [PATCH] fixed json-rpc debug log outputs * moved them up a bit to also log something in case of an error see #482 --- src/client/jsonrpc2.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/jsonrpc2.go b/src/client/jsonrpc2.go index 46242d8..f562d73 100644 --- a/src/client/jsonrpc2.go +++ b/src/client/jsonrpc2.go @@ -121,13 +121,13 @@ func (r *JsonRpc2Client) getRaw(command string, account *string, args interface{ resp = <-responseChan delete(r.receivedResponsesById, u.String()) + log.Debug("json-rpc command response message: ", string(resp.Result)) + log.Debug("json-rpc response error: ", string(resp.Err.Message)) + if resp.Err.Code != 0 { return "", errors.New(resp.Err.Message) } - log.Debug("json-rpc command response message: ", string(resp.Result)) - log.Debug("json-rpc response error: ", string(resp.Err.Message)) - return string(resp.Result), nil }