fix: wrap escalation email in try/catch

This commit is contained in:
2026-04-04 03:19:52 +00:00
parent 1496a96274
commit 5b6d532661

View File

@@ -149,6 +149,7 @@ async function runEscalation(interaction, ticket, nextTier, reason) {
});
if (!isDiscordTicket && ticket.gmailThreadId) {
try {
const emailBody = CONFIG.ESCALATION_MESSAGE.replace(/\{support_name\}/g, CONFIG.SUPPORT_NAME) + (reason ? `\n\nReason: ${reason}` : '');
await sendTicketNotificationEmail(
ticket,
@@ -156,6 +157,9 @@ async function runEscalation(interaction, ticket, nextTier, reason) {
emailBody,
interaction.member?.displayName || interaction.user.username
);
} catch (emailErr) {
console.error('Escalation email failed (non-fatal):', emailErr.message);
}
}
if (nextTier === 2 && ticket.welcomeMessageId) {