From a2826f5bcf0f4297b1b580365344fd6cbdc9ab3e Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 16 Aug 2021 18:02:43 -0400 Subject: [PATCH] check error on json unmarshal --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index 3d6d746..ce5e830 100644 --- a/main.go +++ b/main.go @@ -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" {