check error on json unmarshal

This commit is contained in:
Your Name 2021-08-16 18:02:43 -04:00
parent 61977e06f9
commit a2826f5bcf
1 changed files with 3 additions and 0 deletions

View File

@ -196,6 +196,9 @@ func handleConnection(conn net.Conn, UC MetadataCache, PC MetadataCache) {
_, err := conn.Read(buf)
var c cachecommand
err = json.Unmarshal(buf, &c)
if err != nil {
log.Printf("json.Unmarshal: %s returned %s", buf, err.Error())
}
log.Printf("JSON got: %#v", c)
var values []string
if c.ObjectType == "u" {