From c416386683778d4489569aa5ff3e1c29e832583d Mon Sep 17 00:00:00 2001 From: Julian Kornberger Date: Mon, 7 Mar 2016 01:37:07 +0100 Subject: [PATCH] Log error on WriteToUDP --- respond/collector.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/respond/collector.go b/respond/collector.go index 73c02e6..4b738b9 100644 --- a/respond/collector.go +++ b/respond/collector.go @@ -78,7 +78,9 @@ func (coll *Collector) sendPacket(address string) { log.Panic(err) } - coll.connection.WriteToUDP([]byte(coll.CollectType), addr) + if _, err := coll.connection.WriteToUDP([]byte(coll.CollectType), addr); err != nil { + log.Println("WriteToUDP failed:", err) + } } func (coll *Collector) sender(collectInterval time.Duration) {