Skip to content

Commit

Permalink
Add cleaner error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoutsilis committed Jan 13, 2024
1 parent 85affaa commit 50c6918
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ func sendEmail(to, subject, body string) error {

port, err := strconv.Atoi(strPort)
if err != nil {
return err
return fmt.Errorf("error reading email server port %w", err)
}

d := gomail.NewDialer(host, port, user, password)
s, err := d.Dial()
if err != nil {
return err
return fmt.Errorf("error dialing email server %w", err)
}

m := gomail.NewMessage()
Expand Down

0 comments on commit 50c6918

Please sign in to comment.