Skip to content

Commit

Permalink
chore: add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
KenLSM committed Nov 14, 2024
1 parent e51e6dc commit ef38d81
Showing 1 changed file with 39 additions and 9 deletions.
48 changes: 39 additions & 9 deletions src/app/services/mail/mail.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,15 @@ export class MailService {

const generatedHtml = fromPromise(
render(BounceNotification(htmlData)),
() => {
(e) => {
logger.error({
message: 'Failed to render BounceNotification',
meta: {
action: 'sendBounceNotification',
error: e,
},
})

return new MailGenerationError(
'Error generating bounce notification email',
)
Expand Down Expand Up @@ -1095,10 +1103,16 @@ export class MailService {

const generatedHtml = fromPromise(
render(MrfWorkflowEmail(htmlData)),
() => {
return new MailGenerationError(
'Error generating bounce notification email',
)
(e) => {
logger.error({
message: 'Failed to render MrfWorkflowEmail',
meta: {
action: 'sendMRFWorkflowStepEmail',
error: e,
},
})

return new MailGenerationError('Error generating mrf workflow email')
},
)

Expand Down Expand Up @@ -1138,9 +1152,17 @@ export class MailService {

const generatedHtml = fromPromise(
render(MrfWorkflowCompletionEmail(htmlData)),
() => {
(e) => {
logger.error({
message: 'Failed to render MrfWorkflowCompletionEmail',
meta: {
action: 'sendMrfWorkflowCompletionEmail',
error: e,
},
})

return new MailGenerationError(
'Error generating bounce notification email',
'Error generating mrf workflow completion email',
)
},
)
Expand Down Expand Up @@ -1190,9 +1212,17 @@ export class MailService {

const generatedHtml = fromPromise(
render(MrfWorkflowCompletionEmail(htmlData)),
() => {
(e) => {
logger.error({
message: 'Failed to render MrfWorkflowCompletionEmail',
meta: {
action: 'sendMrfApprovalEmail',
error: e,
},
})

return new MailGenerationError(
'Error generating bounce notification email',
'Error generating mrf workflow completion email',
)
},
)
Expand Down

0 comments on commit ef38d81

Please sign in to comment.