Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

FINERACT-2707: Email campaign JSON parsing failures are silently swallowed instead of logged - #6179

Merged
adamsaghy merged 1 commit into
apache:developfrom
AshharAhmadKhan:FINERACT-2707-log-email-campaign-parse-failures
Jul 27, 2026
Merged

adamsaghy merged 1 commit into
apache:developfrom
AshharAhmadKhan:FINERACT-2707-log-email-campaign-parse-failures

Conversation

@AshharAhmadKhan

Copy link
Copy Markdown
Contributor

JIRA

Problem

Three catch blocks in EmailCampaignWritePlatformCommandHandlerImpl caught IOException from 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 here with a log.error call, including campaign id and name where available.

Both public callers of insertDirectCampaignIntoEmailOutboundTable loop over multiple campaigns in a single pass: EmailCampaignDomainServiceImpl and the scheduled UpdateEmailOutboundWithCampaignMessageTasklet. 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 same IOException.

No functional change otherwise.

Note

SmsCampaignWritePlatformServiceJpaImpl has the same unresolved // TODO throw something here in 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.

…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.
@AshharAhmadKhan

Copy link
Copy Markdown
Contributor Author

hey @adamsaghy please trigger checks here as well when you can, thanks!.

@AshharAhmadKhan

Copy link
Copy Markdown
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.

@adamsaghy adamsaghy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adamsaghy
adamsaghy merged commit cfb8da8 into apache:develop Jul 27, 2026
91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants