Merge branch 'release' into develop

This commit is contained in:
Matteo Pagliazzi 2020-04-06 11:01:29 +02:00
commit cc48479c66
3 changed files with 10 additions and 3 deletions

View file

@ -149,7 +149,10 @@ export async function sendTxn (mailingInfoArray, emailType, variables, personalV
backoff: { delay: 10 * 60 * 1000, type: 'fixed' },
},
},
}).json().catch(err => logger.error(err, 'Error while sending an email.'));
}).json().catch(err => logger.error(err, {
extraMessage: 'Error while sending an email.',
emailType,
}));
}
return null;

View file

@ -19,7 +19,11 @@ function sendWebhook (webhook, body, user) {
// Not calling .json() to parse the response because we simply ignore it
}).catch(webhookErr => {
// Log the error
logger.error(webhookErr, 'Error while sending a webhook request.');
logger.error(webhookErr, {
extraMessage: 'Error while sending a webhook request.',
userId: user._id,
webhook,
});
let _failuresReset = false;

View file

@ -58,7 +58,7 @@ export const schema = new Schema({
required: true,
validate: [v => validator.isURL(v, {
require_tld: !!IS_PRODUCTION, // eslint-disable-line camelcase
require_protocol: true, // TODO migrate existing ones
require_protocol: true,
protocols: ['http', 'https'],
}), shared.i18n.t('invalidUrl')],
},