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 -3
View File
@@ -25,13 +25,16 @@ 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/coverart"
"git.fabledsword.com/bvandeusen/minstrel/internal/db/dbq"
)
// ErrNotFound is returned when the track id doesn't resolve. Handler
// maps to 404 `not_found`.
var ErrNotFound = errors.New("tracks: not found")
// ErrNotFound is returned when the track id doesn't resolve. Aliased
// to apierror.ErrNotFound so handlers can errors.Is against the shared
// sentinel; existing tracks.ErrNotFound callsites still resolve to the
// same pointer.
var ErrNotFound = apierror.ErrNotFound
// LidarrUnmonitorer is the subset of *lidarr.Client RemoveTrack uses.
// Defined as an interface so tests can stub without spinning up a Lidarr