Repository navigation
FINERACT-2707: Email campaign JSON parsing failures are silently swallowed instead of logged - #6179
Merged
adamsaghy merged 1 commit intoJul 27, 2026
Conversation
…lently swallowing them Three catch blocks in EmailCampaignWritePlatformCommandHandlerImpl caught IOException from JSON parsing and did nothing with it. Replaced each with a log.error call including relevant campaign context where available. Both public callers of insertDirectCampaignIntoEmailOutboundTable loop over multiple campaigns in a single pass, including a scheduled batch job. Throwing here would abort processing for every other campaign in that run, so log and continue matches the existing convention already used in the SMS campaign equivalents (SmsCampaignDomainServiceImpl, SmsCampaignWritePlatformServiceJpaImpl). No functional change otherwise.
Contributor
Author
|
hey @adamsaghy please trigger checks here as well when you can, thanks!. |
Contributor
Author
|
hey @adamsaghy , please let me know your thoughts on this, whether it is the correct approach. If so, I will start working on same issue in SmsCampaignWritePlatformServiceJpaImpl. |
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.
JIRA
Problem
Three catch blocks in
EmailCampaignWritePlatformCommandHandlerImplcaughtIOExceptionfrom JSON parsing and did nothing with it. No log, no rethrow. Failures during email campaign processing disappeared silently.Affected methods:
insertDirectCampaignIntoEmailOutboundTable(Loan, EmailCampaign, HashMap)insertDirectCampaignIntoEmailOutboundTable(String, String, String, String, Long)(private overload)previewMessage(JsonQuery)Fix
Replaced each
// TODO throw something herewith alog.errorcall, including campaign id and name where available.Both public callers of
insertDirectCampaignIntoEmailOutboundTableloop over multiple campaigns in a single pass:EmailCampaignDomainServiceImpland the scheduledUpdateEmailOutboundWithCampaignMessageTasklet. Throwing from inside either loop would abort processing for every other campaign in that run. Logging and continuing avoids that regression while still surfacing the failure.This matches the existing convention for the same scenario in the SMS campaign equivalents (
SmsCampaignDomainServiceImpl,SmsCampaignWritePlatformServiceJpaImpl), which already log and continue on the sameIOException.No functional change otherwise.
Note
SmsCampaignWritePlatformServiceJpaImplhas the same unresolved// TODO throw something herein its own preview-message method, the only one in that class not already following the log-and-continue pattern. Planning to file a separate ticket and PR for that as a follow-up, keeping this PR scoped to the email campaign class.