mirror of
https://github.com/taigrr/godns
synced 2025-01-18 04:03:25 -08:00
refactor: update error messages with lowercase
This commit is contained in:
parent
045cb692a5
commit
fa1432be99
6
utils.go
6
utils.go
@ -289,7 +289,7 @@ func SendTelegramNotify(configuration *Settings, domain, currentIP string) error
|
|||||||
err = json.Unmarshal([]byte(body), &resp)
|
err = json.Unmarshal([]byte(body), &resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("error:", err)
|
fmt.Println("error:", err)
|
||||||
return errors.New("Failed to parse response")
|
return errors.New("failed to parse response")
|
||||||
}
|
}
|
||||||
if !resp.Ok {
|
if !resp.Ok {
|
||||||
return errors.New(resp.Description)
|
return errors.New(resp.Description)
|
||||||
@ -313,7 +313,7 @@ func SendMailNotify(configuration *Settings, domain, currentIP string) error {
|
|||||||
log.Println("domain:", domain)
|
log.Println("domain:", domain)
|
||||||
m.SetBody("text/html", buildTemplate(currentIP, domain, mailTemplate))
|
m.SetBody("text/html", buildTemplate(currentIP, domain, mailTemplate))
|
||||||
|
|
||||||
d := gomail.NewPlainDialer(configuration.Notify.Mail.SMTPServer, configuration.Notify.Mail.SMTPPort, configuration.Notify.Mail.SMTPUsername, configuration.Notify.Mail.SMTPPassword)
|
d := gomail.NewDialer(configuration.Notify.Mail.SMTPServer, configuration.Notify.Mail.SMTPPort, configuration.Notify.Mail.SMTPUsername, configuration.Notify.Mail.SMTPPassword)
|
||||||
|
|
||||||
// Send the email config by sendlist .
|
// Send the email config by sendlist .
|
||||||
if err := d.DialAndSend(m); err != nil {
|
if err := d.DialAndSend(m); err != nil {
|
||||||
@ -376,7 +376,7 @@ func SendSlackNotify(configuration *Settings, domain, currentIP string) error {
|
|||||||
err = json.Unmarshal([]byte(body), &resp)
|
err = json.Unmarshal([]byte(body), &resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("error:", err)
|
fmt.Println("error:", err)
|
||||||
return errors.New("Failed to parse response")
|
return errors.New("failed to parse response")
|
||||||
}
|
}
|
||||||
if !resp.Ok {
|
if !resp.Ok {
|
||||||
return errors.New(resp.Description)
|
return errors.New(resp.Description)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user