mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-26 20:00:27 +03:00
Improved error message when -email-from is empty while sending mail
This commit is contained in:
parent
360ae9e4b9
commit
d6e674bcf6
2 changed files with 30 additions and 0 deletions
|
@ -275,6 +275,12 @@ func EmailClient(db store.IStore, mailer emailer.Emailer, emailSubject, emailCon
|
|||
)
|
||||
|
||||
if err != nil {
|
||||
_, isMailError := err.(emailer.SmtpMailError)
|
||||
if isMailError {
|
||||
fmt.Println("SmtpMailError", err)
|
||||
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "An error occurred while sending mail. Contact your administrator."})
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, err.Error()})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue