mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-21 21:30:50 +01:00
Refactor error handling logic and string formatting
Replaced constant with named error for readability and maintainability in the error handling condition. Adjusted error message formatting by removing an extra space for consistency.
This commit is contained in:
parent
27a3985240
commit
25b7f81e3b
1 changed files with 2 additions and 2 deletions
|
@ -81,7 +81,7 @@ type SendErrReason int
|
|||
// Returns:
|
||||
// - A string representing the error message.
|
||||
func (e *SendError) Error() string {
|
||||
if e.Reason > 10 {
|
||||
if e.Reason > ErrAmbiguous {
|
||||
return "unknown reason"
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ func (e *SendError) Error() string {
|
|||
errMessage.WriteRune(' ')
|
||||
errMessage.WriteString(e.errlist[i].Error())
|
||||
if i != len(e.errlist)-1 {
|
||||
errMessage.WriteString(", ")
|
||||
errMessage.WriteString(",")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue