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
+2 -2
View File
@@ -33,7 +33,7 @@ func (a *api) putProgress(c *gin.Context) {
return
}
if e := a.st.UpsertProgress(c, uid(c), b.LibraryID, b.Path, req.Locator, req.Percent); e != nil {
err(c, http.StatusInternalServerError, "internal", "db error")
dbErr(c, e)
return
}
c.Status(http.StatusNoContent)
@@ -42,7 +42,7 @@ func (a *api) putProgress(c *gin.Context) {
func (a *api) listProgress(c *gin.Context) {
rows, e := a.st.ListProgress(c, uid(c))
if e != nil {
err(c, http.StatusInternalServerError, "internal", "db error")
dbErr(c, e)
return
}
out := make([]gin.H, 0, len(rows))