Compare commits

...

2 commits

Author SHA1 Message Date
Alysson Ribeiro
9e0d7a1903
Merge 1fc030afe4 into 37ac2de2af 2024-11-13 13:11:53 +01:00
Alysson Ribeiro
1fc030afe4 Feature(sendError): add unwrap interface 2024-11-07 14:59:06 +01:00

View file

@ -133,6 +133,10 @@ func (e *SendError) Is(errType error) bool {
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.
//
// 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 {
return err.Error()[0] == '4'
}
var _ interface{ Unwrap() []error } = &SendError{}