Update Error Password

This commit is contained in:
aditya.siregar 2024-08-29 23:55:17 +07:00
parent c41cbf91fa
commit 56e704b78b
2 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,7 @@ const (
errOrderNotFound ErrType = "Astria order is not found" errOrderNotFound ErrType = "Astria order is not found"
errCheckoutIDNotDefined ErrType = "Checkout client id not found" errCheckoutIDNotDefined ErrType = "Checkout client id not found"
errInternalServer ErrType = "Internal Server error" errInternalServer ErrType = "Internal Server error"
errExternalServer ErrType = "External Server error"
errUserIsNotFound ErrType = "User is not found" errUserIsNotFound ErrType = "User is not found"
errInvalidLogin ErrType = "User email or password is invalid" errInvalidLogin ErrType = "User email or password is invalid"
errUnauthorized ErrType = "Unauthorized" errUnauthorized ErrType = "Unauthorized"
@ -25,6 +26,7 @@ const (
var ( var (
ErrorBadRequest = NewServiceException(errBadRequest) ErrorBadRequest = NewServiceException(errBadRequest)
ErrorInvalidRequest = NewServiceException(errInvalidRequest) ErrorInvalidRequest = NewServiceException(errInvalidRequest)
ErrorExternalRequest = NewServiceException(errExternalServer)
ErrorUnauthorized = NewServiceException(errUnauthorized) ErrorUnauthorized = NewServiceException(errUnauthorized)
ErrorOrderNotFound = NewServiceException(errOrderNotFound) ErrorOrderNotFound = NewServiceException(errOrderNotFound)
ErrorClientIDNotDefined = NewServiceException(errCheckoutIDNotDefined) ErrorClientIDNotDefined = NewServiceException(errCheckoutIDNotDefined)

View File

@ -158,7 +158,7 @@ func (u *AuthServiceImpl) SendPasswordResetLink(ctx context.Context, email strin
if err != nil { if err != nil {
u.trxRepo.Rollback(trx) u.trxRepo.Rollback(trx)
logger.ContextLogger(ctx).Error("error when sending password reset email", zap.Error(err)) logger.ContextLogger(ctx).Error("error when sending password reset email", zap.Error(err))
return errors.ErrorInternalServer return errors.ErrorExternalRequest
} }
trx.Commit() trx.Commit()