added debug logging

This commit is contained in:
Bernhard B
2024-03-27 16:37:36 +01:00
parent d083ba84e3
commit 3915bd83eb
2 changed files with 9 additions and 0 deletions

View File

@@ -149,6 +149,7 @@ func (r *JsonRpc2Client) getRaw(command string, account *string, args interface{
if resp.Err.Code != 0 {
log.Debug("json-rpc command error code: ", resp.Err.Code)
if resp.Err.Code == -5 {
log.Debug("json-rpc-client: Rate Limit Error received")
var rateLimitMessage RateLimitMessage
err = json.Unmarshal(resp.Err.Data, &rateLimitMessage)
if err != nil {
@@ -157,6 +158,7 @@ func (r *JsonRpc2Client) getRaw(command string, account *string, args interface{
challengeTokens := []string{}
for _, rateLimitResult := range rateLimitMessage.Response.Results {
challengeTokens = append(challengeTokens, rateLimitResult.Token)
log.Debug("json-rpc-client: Received Token: ", rateLimitResult.Token)
}
return "", &RateLimitErrorType{