From db2b02c44d147577f4aafdf53a9d5b671bcf11d4 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sat, 15 Aug 2026 17:59:27 +0200 Subject: [PATCH] fix(stdiscosrv): 500 errors should be accompanied by log entry Signed-off-by: Jakob Borg --- cmd/stdiscosrv/apisrv.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/stdiscosrv/apisrv.go b/cmd/stdiscosrv/apisrv.go index 565206ca1..cecfa9723 100644 --- a/cmd/stdiscosrv/apisrv.go +++ b/cmd/stdiscosrv/apisrv.go @@ -206,6 +206,7 @@ func (s *apiSrv) handleGET(w http.ResponseWriter, req *http.Request) { rec, err := s.db.get(&deviceID) if err != nil { // some sort of internal error + slog.Warn("Failed to handle GET request", "id", reqID, "error", err) lookupRequestsTotal.WithLabelValues("internal_error").Inc() w.Header().Set("Retry-After", errorRetryAfterString()) http.Error(w, "Internal Server Error", http.StatusInternalServerError) @@ -284,7 +285,7 @@ func (s *apiSrv) handlePOST(remoteAddr *net.TCPAddr, w http.ResponseWriter, req } if err := s.handleAnnounce(deviceID, addresses); err != nil { - slog.Debug("Failed to handle request", "id", reqID, "error", err) + slog.Warn("Failed to handle POST request", "id", reqID, "error", err) announceRequestsTotal.WithLabelValues("internal_error").Inc() w.Header().Set("Retry-After", errorRetryAfterString()) http.Error(w, "Internal Server Error", http.StatusInternalServerError)