AshharAhmadKhan opened a new pull request, #6179:
URL: https://github.com/apache/fineract/pull/6179

   ## JIRA
   - https://issues.apache.org/jira/browse/FINERACT-2707
   
   ## 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to