use LogError

This commit is contained in:
Ulf Gebhardt 2023-02-02 13:04:47 +01:00
parent 48dc2821c5
commit fdf22daec7
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -4,6 +4,7 @@ import path from 'path'
import { createTransport } from 'nodemailer'
import Email from 'email-templates'
import i18n from 'i18n'
import LogError from '@/server/LogError'
export const sendEmailTranslated = async (params: {
receiver: {
@ -73,8 +74,7 @@ export const sendEmailTranslated = async (params: {
logger.info('Result: ', result)
})
.catch((error: unknown) => {
logger.error('Error sending notification email: ', error)
throw new Error('Error sending notification email!')
throw new LogError('Error sending notification email', error)
})
i18n.setLocale(rememberLocaleToRestore)