mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-23 22:20:51 +01:00
Update error handling to include error code and status
Previously, only the isTemp flag was considered when aggregating errors. Now, the error code and enhanced status code from the last error are also included. This ensures more comprehensive error reporting and handling.
This commit is contained in:
parent
719e5b217c
commit
a5ac7c3370
1 changed files with 3 additions and 1 deletions
|
@ -55,9 +55,11 @@ func (c *Client) Send(messages ...*Msg) error {
|
||||||
returnErr.rcpt = append(returnErr.rcpt, errs[i].rcpt...)
|
returnErr.rcpt = append(returnErr.rcpt, errs[i].rcpt...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// We assume that the isTemp flag from the last error we received should be the
|
// We assume that the error codes and flags from the last error we received should be the
|
||||||
// indicator for the returned isTemp flag as well
|
// indicator for the returned isTemp flag as well
|
||||||
returnErr.isTemp = errs[len(errs)-1].isTemp
|
returnErr.isTemp = errs[len(errs)-1].isTemp
|
||||||
|
returnErr.errcode = errs[len(errs)-1].errcode
|
||||||
|
returnErr.enhancedStatusCode = errs[len(errs)-1].enhancedStatusCode
|
||||||
|
|
||||||
return returnErr
|
return returnErr
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue