From 56e704b78bf631facee0a409e3a63a7106b7f355 Mon Sep 17 00:00:00 2001 From: "aditya.siregar" Date: Thu, 29 Aug 2024 23:55:17 +0700 Subject: [PATCH] Update Error Password --- internal/common/errors/errors.go | 2 ++ internal/services/auth/init.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/common/errors/errors.go b/internal/common/errors/errors.go index 134d516..9bea836 100644 --- a/internal/common/errors/errors.go +++ b/internal/common/errors/errors.go @@ -14,6 +14,7 @@ const ( errOrderNotFound ErrType = "Astria order is not found" errCheckoutIDNotDefined ErrType = "Checkout client id not found" errInternalServer ErrType = "Internal Server error" + errExternalServer ErrType = "External Server error" errUserIsNotFound ErrType = "User is not found" errInvalidLogin ErrType = "User email or password is invalid" errUnauthorized ErrType = "Unauthorized" @@ -25,6 +26,7 @@ const ( var ( ErrorBadRequest = NewServiceException(errBadRequest) ErrorInvalidRequest = NewServiceException(errInvalidRequest) + ErrorExternalRequest = NewServiceException(errExternalServer) ErrorUnauthorized = NewServiceException(errUnauthorized) ErrorOrderNotFound = NewServiceException(errOrderNotFound) ErrorClientIDNotDefined = NewServiceException(errCheckoutIDNotDefined) diff --git a/internal/services/auth/init.go b/internal/services/auth/init.go index 6ab72fe..f42e8d8 100644 --- a/internal/services/auth/init.go +++ b/internal/services/auth/init.go @@ -158,7 +158,7 @@ func (u *AuthServiceImpl) SendPasswordResetLink(ctx context.Context, email strin if err != nil { u.trxRepo.Rollback(trx) logger.ContextLogger(ctx).Error("error when sending password reset email", zap.Error(err)) - return errors.ErrorInternalServer + return errors.ErrorExternalRequest } trx.Commit()