Skip to content

Commit

Permalink
refactor: error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhorvat committed Aug 29, 2024
1 parent fdc0738 commit 5ebe454
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions controller/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ func (c Controller) RegisterUser(ctx *gin.Context) {

err = c.sendVerificationEmail(ctx, user)
if err != nil {
c.SendResponse(ctx, Response{
Status: http.StatusInternalServerError,
Error: err.Error(),
})
return
log.Println("failed to send an email : ", err.Error())
}

c.SendResponse(ctx, Response{
Expand Down Expand Up @@ -596,8 +592,7 @@ func (c Controller) sendVerificationEmail(ctx *gin.Context, user *models.User) e

err = c.service.SendVerificationLinkEmail(user.EmailAddress, verificationToken.Token)
if err != nil {
log.Println("failed to send an email")
return nil
return err
}

return nil
Expand Down

0 comments on commit 5ebe454

Please sign in to comment.