1// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2// See LICENSE.txt for license information. 3 4package users 5 6import "errors" 7 8var ( 9 AcceptedDomainError = errors.New("the email provided does not belong to an accepted domain") 10 VerifyUserError = errors.New("could not update verify email field") 11 UserCountError = errors.New("could not get the total number of the users.") 12 UserCreationDisabledError = errors.New("user creation is not allowed") 13 UserStoreIsEmptyError = errors.New("could not check if the user store is empty") 14 15 GetTokenError = errors.New("could not get token") 16 GetSessionError = errors.New("could not get session") 17 DeleteTokenError = errors.New("could not delete token") 18 DeleteSessionError = errors.New("could not delete session") 19 DeleteAllAccessDataError = errors.New("could not delete all access data") 20 21 DefaultFontError = errors.New("could not get default font") 22 UserInitialsError = errors.New("could not get user initials") 23 ImageEncodingError = errors.New("could not encode image") 24) 25 26// ErrInvalidPassword indicates an error against the password settings 27type ErrInvalidPassword struct { 28 id string 29} 30 31func NewErrInvalidPassword(id string) *ErrInvalidPassword { 32 return &ErrInvalidPassword{ 33 id: id, 34 } 35} 36 37func (e *ErrInvalidPassword) Error() string { 38 return "invalid password" 39} 40 41func (e *ErrInvalidPassword) Id() string { 42 return e.id 43} 44