print to find bug

This commit is contained in:
mr 2024-09-23 11:23:51 +02:00
parent a4374602e1
commit 6c9b9ea30d

View File

@ -126,11 +126,10 @@ func (p *PeerCache) exec(url string, method tools.METHOD, body map[string]interf
var m map[string]interface{} var m map[string]interface{}
json.Unmarshal(b, &m) json.Unmarshal(b, &m)
if err != nil { if err != nil {
fmt.Println("response", err)
return err return err
} }
fmt.Println("response", m["error"]) fmt.Println("response", m["error"], m["error"] != "<nil>")
if e, ok := m["error"]; !ok && e != "" && e != "<nil>" { // Check if there is an error in the response if e, ok := m["error"]; ok && e != "<nil>" { // Check if there is an error in the response
return errors.New(fmt.Sprintf("%v", m["error"])) return errors.New(fmt.Sprintf("%v", m["error"]))
} }
return nil return nil