mirror of
https://github.com/1f349/lotus.git
synced 2024-12-22 08:04:06 +00:00
Add logging for failure to send mail
This commit is contained in:
parent
306f2c1e8e
commit
2e5505bc5e
@ -7,6 +7,7 @@ import (
|
||||
postfixLookup "github.com/1f349/lotus/postfix-lookup"
|
||||
"github.com/1f349/lotus/smtp"
|
||||
"github.com/julienschmidt/httprouter"
|
||||
"log"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
@ -61,8 +62,9 @@ func MessageSender(send Smtp) func(rw http.ResponseWriter, req *http.Request, pa
|
||||
}
|
||||
|
||||
// try sending the mail
|
||||
if send.Send(mail) != nil {
|
||||
if err := send.Send(mail); err != nil {
|
||||
apiError(rw, http.StatusInternalServerError, "Failed to send mail")
|
||||
log.Printf("Failed to send mail: %#v: %s\n", mail, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user