catch error on createUser and log them

This commit is contained in:
Ulf Gebhardt 2021-11-17 19:37:35 +01:00
parent c2a3866ae5
commit 5335d12802
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -145,14 +145,19 @@ export const elopageWebhook = async (req: any, res: any): Promise<void> => {
randomBytes(8).toString('hex') + email + '!aA1' + randomBytes(8).toString('hex')
const userResolver = new UserResolver()
userResolver.createUser({
email,
firstName,
lastName,
password,
language: 'default',
publisherId: loginElopgaeBuy.publisherId,
})
try {
await userResolver.createUser({
email,
firstName,
lastName,
password,
language: 'default',
publisherId: loginElopgaeBuy.publisherId,
})
} catch (error) {
// eslint-disable-next-line no-console
console.log(`Could not create User for ${email}. Following Error occured:`, error)
}
}
}