Merge pull request #2656 from gradido/logger_sendEMailTranslated

refactor(backend): use LogError on sendEMailTranslated
This commit is contained in:
Ulf Gebhardt 2023-02-02 16:34:24 +01:00 committed by GitHub
commit 9f906f4939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)