slack-auth-1770277926/services/auth-api/internal/domain/errors.go
rdev-worker fd9bf961bb
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
build: /implement-feature auth-system --requirements 'User model with email/...
2026-02-05 07:59:55 +00:00

37 lines
1.4 KiB
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")
// ErrExampleNotFound indicates the requested example does not exist.
ErrExampleNotFound = errors.New("example not found")
// ErrDuplicateExample indicates an example with the same name already exists.
ErrDuplicateExample = errors.New("example with this name already exists")
// ErrInvalidExampleName indicates the example name is invalid.
ErrInvalidExampleName = errors.New("invalid example name")
// ErrUserNotFound indicates the requested user does not exist.
ErrUserNotFound = errors.New("user not found")
// ErrDuplicateUser indicates a user with the same email already exists.
ErrDuplicateUser = errors.New("user with this email already exists")
// ErrInvalidEmail indicates the email is invalid.
ErrInvalidEmail = errors.New("invalid email")
// ErrInvalidPassword indicates the password is invalid.
ErrInvalidPassword = errors.New("invalid password")
// ErrInvalidCredentials indicates invalid login credentials.
ErrInvalidCredentials = errors.New("invalid credentials")
)