From 68e0da1133deba72966f538c73729c871bb33547 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Fri, 20 Mar 2026 05:01:52 +0000 Subject: [PATCH] Add log message when we can't marshal JSON Been seeing this in prod --- api/handler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/api/handler.go b/api/handler.go index 3fbf8ec0..f90a362a 100644 --- a/api/handler.go +++ b/api/handler.go @@ -56,6 +56,7 @@ func authenticatedHandlerJSON[T any](f handlerFunctionGet[T]) http.Handler { } body, err = json.Marshal(resp) if err != nil { + log.Error().Err(err).Msg("failed to marshal json") http.Error(w, "{\"message\": \"failed to marshal json\"}", http.StatusInternalServerError) return }