refactor(server): final writeErr migration + ErrNotFound aliases (T3c)

This commit is contained in:
2026-05-07 21:19:35 -04:00
parent 91f4f5c18a
commit 754a7955cc
14 changed files with 182 additions and 147 deletions
+6 -2
View File
@@ -13,6 +13,7 @@ import (
"github.com/jackc/pgx/v5/pgtype"
"github.com/jackc/pgx/v5/pgxpool"
"git.fabledsword.com/bvandeusen/minstrel/internal/apierror"
"git.fabledsword.com/bvandeusen/minstrel/internal/db/dbq"
"git.fabledsword.com/bvandeusen/minstrel/internal/lidarr"
"git.fabledsword.com/bvandeusen/minstrel/internal/lidarrconfig"
@@ -22,8 +23,11 @@ import (
var (
ErrInvalidKindFields = errors.New("lidarrrequests: missing required fields for kind")
ErrNotPending = errors.New("lidarrrequests: request is not pending")
ErrNotFound = errors.New("lidarrrequests: request not found")
ErrLidarrDisabled = errors.New("lidarrrequests: lidarr not configured")
// ErrNotFound aliases apierror.ErrNotFound so handlers can errors.Is
// against the shared sentinel; existing lidarrrequests.ErrNotFound
// callsites still resolve to the same pointer.
ErrNotFound = apierror.ErrNotFound
ErrLidarrDisabled = errors.New("lidarrrequests: lidarr not configured")
// ErrDefaultsIncomplete fires when Lidarr is enabled but the operator
// hasn't picked a default quality profile or root folder. Without those,
// Lidarr's add-artist/add-album endpoints reject the payload with a