From 4bf31fb511e1a8e8b356a62caf9de754b82bb64a Mon Sep 17 00:00:00 2001 From: mkelvers Date: Tue, 26 May 2026 15:30:28 +0200 Subject: [PATCH] fix: log and abort on missing catalog/discover sections --- internal/anime/handler/handler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/anime/handler/handler.go b/internal/anime/handler/handler.go index 397ee47..182abd5 100644 --- a/internal/anime/handler/handler.go +++ b/internal/anime/handler/handler.go @@ -168,6 +168,8 @@ func (h *AnimeHandler) renderCatalogSection(c *gin.Context, section string) { } data, err := h.svc.GetCatalogSection(c.Request.Context(), userID, section) if err != nil { + log.Printf("failed to fetch catalog section (section=%q user_id=%q): %v", section, userID, err) + c.AbortWithStatus(http.StatusInternalServerError) return } @@ -207,6 +209,8 @@ func (h *AnimeHandler) renderDiscoverSection(c *gin.Context, section string) { } data, err := h.svc.GetDiscoverSection(c.Request.Context(), userID, section) if err != nil { + log.Printf("failed to fetch discover section (section=%q user_id=%q): %v", section, userID, err) + c.AbortWithStatus(http.StatusInternalServerError) return }