From 4606c790f1c6058e2a34565794d44cc34d3d81d8 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Sun, 24 May 2026 22:46:02 +0200 Subject: [PATCH] fix: handle backend errors and driver import --- internal/anime/handler/handler.go | 2 ++ internal/db/sqlite.go | 1 + internal/playback/handler/handler.go | 2 ++ 3 files changed, 5 insertions(+) diff --git a/internal/anime/handler/handler.go b/internal/anime/handler/handler.go index 378f5ff..efcc080 100644 --- a/internal/anime/handler/handler.go +++ b/internal/anime/handler/handler.go @@ -171,6 +171,8 @@ func (h *AnimeHandler) HandleBrowse(c *gin.Context) { res, err := h.svc.SearchAdvanced(c.Request.Context(), q, animeType, status, orderBy, sort, genres, sfw, page, 24) if err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) + return } user, _ := c.Get("User") diff --git a/internal/db/sqlite.go b/internal/db/sqlite.go index 274431f..3031c28 100644 --- a/internal/db/sqlite.go +++ b/internal/db/sqlite.go @@ -5,6 +5,7 @@ import ( "fmt" "os" + // sqlite3 driver. _ "github.com/mattn/go-sqlite3" ) diff --git a/internal/playback/handler/handler.go b/internal/playback/handler/handler.go index f5f3c54..e189605 100644 --- a/internal/playback/handler/handler.go +++ b/internal/playback/handler/handler.go @@ -238,6 +238,8 @@ func (h *PlaybackHandler) HandleEpisodeThumbnails(c *gin.Context) { allEpisodes, err := h.animeSvc.GetAllEpisodes(c.Request.Context(), id) if err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) + return } anime, _ := h.animeSvc.GetAnimeByID(c.Request.Context(), id)