Skip to content

Commit 387d9ec

Browse files
committed
feat: add sentry logging
1 parent ad0ce95 commit 387d9ec

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/scripts/cronjobs/emailBreachAlerts.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,16 @@ export async function poll(
320320
// in between sending the email and marking as notified, otherwise
321321
// there is an unlikely edge case of sending multiple emails
322322
errorRecipients.push(breachedEmail);
323+
Sentry.captureException(e, {
324+
tags: {
325+
breach_name: breachAlert.Name,
326+
notification_stage: "email_send",
327+
},
328+
extra: {
329+
subscriber_id: subscriberId,
330+
breach_id: breachId,
331+
},
332+
});
323333
}
324334
}
325335
}
@@ -341,6 +351,15 @@ export async function poll(
341351
/* c8 ignore start */
342352
} catch (error) {
343353
console.error(`Notifying subscribers of breach failed: ${error}`);
354+
Sentry.captureException(error, {
355+
tags: {
356+
breach_name: breachAlert.Name,
357+
notification_stage: "initial_processing",
358+
},
359+
extra: {
360+
breach_id: breachId,
361+
},
362+
});
344363
}
345364
/* c8 ignore stop */
346365
}

0 commit comments

Comments
 (0)