diff options
Diffstat (limited to 'src/helsinki.at/rhrdtime')
-rw-r--r-- | src/helsinki.at/rhrdtime/rhrdtime.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/helsinki.at/rhrdtime/rhrdtime.go b/src/helsinki.at/rhrdtime/rhrdtime.go index 3501942..519d465 100644 --- a/src/helsinki.at/rhrdtime/rhrdtime.go +++ b/src/helsinki.at/rhrdtime/rhrdtime.go @@ -56,7 +56,7 @@ func getRDWeekAndOffset(t time.Time) (uint8, int) { loc, err := time.LoadLocation("Europe/Vienna") if err != nil { - fmt.Println(err) + fmt.Println("Error while loading loaction Europe/Vienna:", err) return 0, 0 } @@ -98,7 +98,7 @@ func handleNTPClient(w http.ResponseWriter, r *http.Request) { var n ntpMessage if err := json.Unmarshal(msg, &n); err != nil { - fmt.Println("ignoring mallformed (", err, ") NTP message from:", ws.RemoteAddr()) + fmt.Println("Ignoring malformed (", err, ") NTP message from:", ws.RemoteAddr()) continue } @@ -110,10 +110,11 @@ func handleNTPClient(w http.ResponseWriter, r *http.Request) { ntp_json, err := json.Marshal(n) if err != nil { - fmt.Println(err) + fmt.Println("Error while encoding to json:", err) continue } if err := ws.WriteMessage(websocket.TextMessage, ntp_json); err != nil { + fmt.Println("Client", ws.RemoteAddr(), "write error:", err) return } } |