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 -1
View File
@@ -24,13 +24,18 @@ 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"
)
// Typed errors. The API layer maps each to its wire status code; tests
// use errors.Is to assert the right path was taken.
//
// ErrNotFound aliases apierror.ErrNotFound so handlers can errors.Is
// against the shared sentinel; existing playlists.ErrNotFound callsites
// still resolve to the same pointer.
var (
ErrNotFound = errors.New("playlists: playlist not found")
ErrNotFound = apierror.ErrNotFound
ErrForbidden = errors.New("playlists: forbidden")
ErrInvalidInput = errors.New("playlists: invalid input")
ErrTrackNotFound = errors.New("playlists: track not found")