fix(backend): dbErr 503 degradation for connection-class DB errors

This commit is contained in:
2026-09-06 19:53:19 +08:00
parent 04095b5438
commit a11bf28155
8 changed files with 61 additions and 18 deletions
+1 -3
View File
@@ -3,7 +3,6 @@ package api
import (
"context"
"io"
"log"
"net/http"
"os"
"path/filepath"
@@ -31,8 +30,7 @@ func (a *api) libRoot(c *gin.Context, lib store.Library) (string, bool) {
func (a *api) listLibraries(c *gin.Context) {
libs, e := a.st.ListLibraries(c)
if e != nil {
log.Printf("db: %v", e)
err(c, http.StatusInternalServerError, "internal", "db error")
dbErr(c, e)
return
}
out := make([]gin.H, 0, len(libs))