refactor(service,user): move user-service specific errors to user.go

This commit is contained in:
Guz
2025-06-10 19:05:31 -03:00
parent 9a110a814b
commit 05e1b4b84d
2 changed files with 7 additions and 4 deletions

View File

@@ -1 +1,5 @@
package service
import "forge.capytal.company/capytalcode/project-comicverse/repository"
var ErrNotFound = repository.ErrNotFound

View File

@@ -88,8 +88,7 @@ func (svc *User) Login(username, password string) (user model.User, err error) {
}
var (
ErrAlreadyExists = errors.New("model already exists")
ErrNotFound = repository.ErrNotFound
ErrPasswordTooLong = bcrypt.ErrPasswordTooLong
ErrIncorrectPassword = bcrypt.ErrMismatchedHashAndPassword
ErrUsernameAlreadyExists = errors.New("service: username already exists")
ErrPasswordTooLong = bcrypt.ErrPasswordTooLong
ErrIncorrectPassword = bcrypt.ErrMismatchedHashAndPassword
)