From 05e1b4b84d6cfaf0f2eb0fb40ffb2cb388638d39 Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L de Mello" Date: Tue, 10 Jun 2025 19:05:31 -0300 Subject: [PATCH] refactor(service,user): move user-service specific errors to user.go --- service/service.go | 4 ++++ service/user.go | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/service/service.go b/service/service.go index 6d43c33..5c40c6e 100644 --- a/service/service.go +++ b/service/service.go @@ -1 +1,5 @@ package service + +import "forge.capytal.company/capytalcode/project-comicverse/repository" + +var ErrNotFound = repository.ErrNotFound diff --git a/service/user.go b/service/user.go index ab0f1ea..3766a76 100644 --- a/service/user.go +++ b/service/user.go @@ -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 )