slack5-1770541397/services/preferences-api/internal/domain/errors.go
rdev-worker e3e19a3fa8
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature user-preferences
2026-02-08 09:29:22 +00:00

25 lines
998 B
Go

// Package domain contains pure domain models with no external dependencies.
// These types represent the core business concepts of the service.
package domain
import "errors"
// Domain errors - these are business-level errors that should be translated
// to appropriate HTTP status codes by the handler layer.
var (
// ErrNotFound indicates a requested resource does not exist.
ErrNotFound = errors.New("not found")
// ErrPreferencesNotFound indicates no preferences exist for the user.
ErrPreferencesNotFound = errors.New("preferences not found")
// ErrInvalidTheme indicates the theme value is not one of light, dark, system.
ErrInvalidTheme = errors.New("invalid theme: must be one of light, dark, system")
// ErrInvalidLanguage indicates the language value exceeds 10 characters.
ErrInvalidLanguage = errors.New("invalid language: must be at most 10 characters")
// ErrForbidden indicates the user is not authorized for this operation.
ErrForbidden = errors.New("forbidden")
)