package errs import ( "errors" "fmt" ) var ( // ErrInvalidConfig is returned when the configuration is invalid. ErrInvalidConfig = errors.New("invalid configuration") // ErrInvalidShort. ErrInvalidShort = errors.New("invalid short") // ErrShortDoesNotExist. ErrShortDoesNotExist = errors.New("short does not exist") // ErrShortExists. ErrShortExists = errors.New("short already exists") // ErrUserDoesNotExist. ErrUserDoesNotExist = errors.New("user does not exist") // ErrUserExists. ErrUserExists = errors.New("user already exists") // ErrInvalidUser. ErrInvalidUser = errors.New("invalid user") // ErrFailedAuthentication. ErrFailedAuthentication = errors.New("failed authentication") // ErrInvalidUsernameOrPassword. ErrInvalidUsernameOrPassword = errors.New("invalid username or password") // ErrRegistrationDisabled. ErrRegistrationDisabled = errors.New("registration is disabled") // ErrSessionDoesNotExist. ErrSessionDoesNotExist = errors.New("session does not exist") // ErrTokenDoesNotExist. ErrTokenDoesNotExist = errors.New("token does not exist") // ErrTokenExists. ErrTokenExists = errors.New("token already exists") // ErrTokenMissing. ErrTokenMissing = errors.New("token missing") // ErrInvalidToken. ErrInvalidToken = errors.New("invalid token") // ErrInvalidTokenID. ErrInvalidTokenID = errors.New("invalid token ID") // ErrInvalidTokenName. ErrInvalidTokenName = errors.New("invalid token name") // ErrDatabaseError. ErrDatabaseError = errors.New("database error") // ErrShortLogExists. ErrShortLogExists = errors.New("short log already exists") // ErrStorageNotStarted. ErrStorageNotStarted = errors.New("storage not started") // ErrStorageStarted. ErrStorageStarted = errors.New("storage already started") // ErrOIDCStateCookieMissing. ErrOIDCStateCookieMissing = errors.New("OIDC state cookie missing") // ErrOIDCStateCookieInvalid. ErrOIDCStateCookieInvalid = errors.New("OIDC state cookie invalid") // ErrCredentialsLoginDisabled. ErrCredentialsLoginDisabled = errors.New("credentials login disabled") ) func Errorf(msg string, err error) error { return fmt.Errorf("%s: %w", msg, err) }