refactor(server): final writeErr migration + ErrNotFound aliases (T3c)
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user