fix: clarify SES no-tracking config set failures#377
Open
S1lander wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves error reporting when AWS SES rejects an email send by wrapping sendRawEmail with a try/catch that adds the configuration set name, a hint about SES_CONFIGURATION_SET_NO_TRACKING for preview/test emails, and preserves the original error as cause.
Changes:
- Wrap the
ses.sendRawEmailcall in a try/catch inSESService.ts. - Throw an enriched
Errorcontaining the configuration set name, optional no-tracking hint, and the original SES error message. - Preserve original error context using
Error'scauseoption.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR improves server-side error reporting when AWS SES rejects an email because the selected "no-tracking" configuration set does not exist. I ran into this while trying to send a preview email for a campaign, which didn't work and only returned a minimal error message.
Preview/test campaign emails disable tracking, which causes the API to use
SES_CONFIGURATION_SET_NO_TRACKINGwhen the tracking toggle is enabled. If that no-tracking configuration set is missing or misconfigured in AWS SES, the previous error was insufficient from the server logs.This change wraps the SES
sendRawEmailcall with contextual error handling and includes:SES_CONFIGURATION_SET_NO_TRACKINGcauseType of Change
feat:New feature (MINOR version bump)fix:Bug fix (PATCH version bump)feat!:Breaking change - new feature (MAJOR version bump)fix!:Breaking change - bug fix (MAJOR version bump)docs:Documentation update (no version bump)chore:Maintenance/dependencies (no version bump)refactor:Code refactoring (no version bump)test:Adding tests (no version bump)perf:Performance improvement (PATCH version bump)Testing
Tested manually in a local Docker setup by invoking
sendRawEmailinside the API container with:tracking: falseSES_CONFIGURATION_SET_NO_TRACKING=plunk-no-tracking-configuration-setConfirmed the server-side error now includes: