-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose error code in SendError #368
Commits on Nov 13, 2024
-
Add enhanced status code and error code to SendError
Enhance error handling by adding error code and enhanced status code to the SendError struct. This allows for better troubleshooting and debugging by providing more detailed SMTP server responses.
Configuration menu - View commit details
-
Copy full SHA for 6809084 - Browse repository at this point
Copy the full SHA 6809084View commit details -
Change test server port base for SMTP client tests
Updated the TestServerPortBase from 12025 to 30025 to avoid port conflicts with other services running on the common 12025 port. This adjustment aims to ensure that the tests run reliably in diverse environments.
Configuration menu - View commit details
-
Copy full SHA for b9d9449 - Browse repository at this point
Copy the full SHA b9d9449View commit details -
Add ErrorCode method to SendError
Implemented ErrorCode method to retrieve the error code from the server response in SendError. This method distinguishes between server-generated errors and client-generated errors, returning 0 for errors generated by the client.
Configuration menu - View commit details
-
Copy full SHA for ad265ca - Browse repository at this point
Copy the full SHA ad265caView commit details -
Add tests for SendError's enhanced status and error codes
Implemented new unit tests for SendError to validate the enhanced status code and error codes in various scenarios, including nil SendError cases, errors with no enhanced status code, and errors with both permanent and temporary error codes. This ensures the correctness of the error handling behavior across different conditions.
Configuration menu - View commit details
-
Copy full SHA for 615155b - Browse repository at this point
Copy the full SHA 615155bView commit details -
Add tests for getErrorCode function
Introduce a suite of unit tests for the getErrorCode function to validate its behavior with various error types, including go-mail errors, permanent and temporary errors, wrapper errors, non-4xx/5xx errors, and non-3-digit codes.
Configuration menu - View commit details
-
Copy full SHA for e8fb977 - Browse repository at this point
Copy the full SHA e8fb977View commit details -
Refactor error handling by renaming functions.
Renamed `getErrorCode` to `errorCode` and `getEnhancedStatusCode` to `enhancedStatusCode` for consistency. Updated all references in `client.go` and `senderror.go` accordingly, improving readability and maintaining uniformity across the codebase.
Configuration menu - View commit details
-
Copy full SHA for 6268aca - Browse repository at this point
Copy the full SHA 6268acaView commit details -
Refactor error code functions and add enhanced status code tests
Renamed `getErrorCode` function to `errorCode` for consistency. Added new tests for the `enhancedStatusCode` function to validate its behavior with various error scenarios.
Configuration menu - View commit details
-
Copy full SHA for f367db0 - Browse repository at this point
Copy the full SHA f367db0View commit details -
Enhance error handling with ENHANCEDSTATUSCODES check
Added a check for the ENHANCEDSTATUSCODES extension and included error code and enhanced status code information in SendError. This helps in providing more detailed error reporting and troubleshooting.
Configuration menu - View commit details
-
Copy full SHA for 719e5b2 - Browse repository at this point
Copy the full SHA 719e5b2View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for a5ac7c3 - Browse repository at this point
Copy the full SHA a5ac7c3View commit details
Commits on Nov 14, 2024
-
Enhance error handling in Client's Send method
Added support for Enhanced Status Codes (ESC) when checking the SMTP client's extensions. The SendError struct now includes the error code and enhanced status code for improved diagnostics.
Configuration menu - View commit details
-
Copy full SHA for c8d7cf8 - Browse repository at this point
Copy the full SHA c8d7cf8View commit details -
Refactor SendError initialization for better readability
Structured the initialization of SendError on connection errors to improve code readability and maintainability. This change affects the error handling in both client_120.go and client_119.go by spreading the error details across multiple lines.
Configuration menu - View commit details
-
Copy full SHA for bd655b7 - Browse repository at this point
Copy the full SHA bd655b7View commit details -
Allow configuration of test server port via environment variable
Moved TestServerPortBase initialization to use an environment variable `TEST_BASEPORT` if provided. This adjustment helps in specifying custom base ports for running tests, ensuring better flexibility in different testing environments.
Configuration menu - View commit details
-
Copy full SHA for ca3f505 - Browse repository at this point
Copy the full SHA ca3f505View commit details -
Add TEST_BASEPORT environment variable to CI workflow
In the CI configuration file, the TEST_BASEPORT environment variable was added to various job scopes. This ensures consistency and allows the test base port to be set properly across different OS versions and Go versions.
Configuration menu - View commit details
-
Copy full SHA for a70dde5 - Browse repository at this point
Copy the full SHA a70dde5View commit details -
Update SMTP test port variable and CI configuration
Changed the SMTP test server base port and updated the corresponding environment variable name to `TEST_BASEPORT_SMTP`. This ensures consistency across the test setup and CI workflow configuration.
Configuration menu - View commit details
-
Copy full SHA for 2bde340 - Browse repository at this point
Copy the full SHA 2bde340View commit details