diff --git a/apps/dashboard/jobs/tasks/invoice/email/send-email.tsx b/apps/dashboard/jobs/tasks/invoice/email/send-email.tsx index c0558916af..38e697e431 100644 --- a/apps/dashboard/jobs/tasks/invoice/email/send-email.tsx +++ b/apps/dashboard/jobs/tasks/invoice/email/send-email.tsx @@ -56,10 +56,16 @@ export const sendInvoiceEmail = schemaTask({ ), }); - logger.info("Invoice email sent", { - invoiceId, - response, - }); + if (response.error) { + logger.error("Invoice email failed to send", { + invoiceId, + error: response.error, + }); + + throw new Error("Invoice email failed to send"); + } + + logger.info("Invoice email sent"); await supabase .from("invoices")