From a5ac7c33708413f39ad99001ef01570e65603280 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Wed, 13 Nov 2024 23:04:39 +0100 Subject: [PATCH] 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. --- client_119.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client_119.go b/client_119.go index b9931b8..5837337 100644 --- a/client_119.go +++ b/client_119.go @@ -55,9 +55,11 @@ func (c *Client) Send(messages ...*Msg) error { 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 returnErr.isTemp = errs[len(errs)-1].isTemp + returnErr.errcode = errs[len(errs)-1].errcode + returnErr.enhancedStatusCode = errs[len(errs)-1].enhancedStatusCode return returnErr }