Files
galaxy-game/user/internal/ports/errors.go
T
2026-04-10 19:05:02 +02:00

32 lines
1.1 KiB
Go

// Package ports defines the storage-agnostic boundaries used by the user
// service.
package ports
import (
"errors"
"fmt"
)
var (
// ErrNotFound reports that a requested source-of-truth record does not
// exist in the dependency behind the port.
ErrNotFound = errors.New("ports: record not found")
// ErrConflict reports that a create or update cannot be applied because the
// dependency state conflicts with the requested mutation.
ErrConflict = errors.New("ports: conflict")
// ErrInvalidPageToken reports that a supplied pagination token cannot be
// decoded or does not match the expected filter set.
ErrInvalidPageToken = errors.New("ports: invalid page token")
)
var (
// ErrRaceNameConflict reports that a mutation specifically failed because a
// race-name lookup or canonical reservation is already owned by another
// user. The sentinel still matches ErrConflict via errors.Is so callers can
// preserve the stable public conflict semantics while collecting more
// precise observability.
ErrRaceNameConflict = fmt.Errorf("%w: race name conflict", ErrConflict)
)