exterrors: Don't assume SMTPERror.Err != nil

This commit is contained in:
fox.cpp 2019-11-19 14:14:07 +03:00
parent 8c156406d6
commit 61d02d5658
No known key found for this signature in database
GPG key ID: E76D97CCEDE90B6C

View file

@ -97,7 +97,13 @@ func (se *SMTPError) Temporary() bool {
}
func (se *SMTPError) Error() string {
return se.Err.Error()
if se.Reason != "" {
return se.Reason
}
if se.Err != nil {
return se.Err.Error()
}
return se.Message
}
// SMTPCode is a convenience function that returns one of its arguments