This commit is contained in:
Alysson Ribeiro 2024-11-08 19:36:55 +01:00 committed by GitHub
commit c99b6e24c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -133,6 +133,10 @@ func (e *SendError) Is(errType error) bool {
return false return false
} }
func (e *SendError) Unwrap() []error {
return e.errlist
}
// IsTemp returns true if the delivery error is of a temporary nature and can be retried. // IsTemp returns true if the delivery error is of a temporary nature and can be retried.
// //
// This function checks whether the SendError indicates a temporary error, which suggests // This function checks whether the SendError indicates a temporary error, which suggests
@ -224,3 +228,5 @@ func (r SendErrReason) String() string {
func isTempError(err error) bool { func isTempError(err error) bool {
return err.Error()[0] == '4' return err.Error()[0] == '4'
} }
var _ interface{ Unwrap() []error } = &SendError{}