chore: Standardize error message extraction in contact form actions and mailer, and add Directus restart to the Directus sync script.
All checks were successful
Build & Deploy KLZ Cables / 🔍 Prepare Environment (push) Successful in 14s
Build & Deploy KLZ Cables / 🧪 Quality Assurance (push) Has been skipped
Build & Deploy KLZ Cables / 🏗️ Build App (push) Has been skipped
Build & Deploy KLZ Cables / 🚀 Deploy (push) Has been skipped
Build & Deploy KLZ Cables / ⚡ PageSpeed (push) Has been skipped
Build & Deploy KLZ Cables / 🔔 Notifications (push) Successful in 2s

This commit is contained in:
2026-02-06 17:55:43 +01:00
parent 8a751998eb
commit d027fbeac2
4 changed files with 18 additions and 6 deletions

View File

@@ -48,7 +48,8 @@ export async function sendEmail({ to, subject, html }: SendEmailOptions) {
logger.info('Email sent successfully', { messageId: info.messageId, subject, recipients });
return { success: true, messageId: info.messageId };
} catch (error) {
logger.error('Error sending email', { error, subject, recipients });
return { success: false, error };
const errorMsg = error instanceof Error ? error.message : String(error);
logger.error('Error sending email', { error: errorMsg, subject, recipients });
return { success: false, error: errorMsg };
}
}