0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Captured bulk-email errors in Sentry

no issue
This commit is contained in:
Daniel Lockyer 2020-03-04 13:44:23 +00:00
parent 4fda464103
commit edfc07b9c8

View file

@ -3,6 +3,7 @@ const common = require('../../lib/common');
const mailgunProvider = require('./mailgun');
const configService = require('../../config');
const settingsCache = require('../settings/cache');
const sentry = require('../../sentry');
/**
* An object representing batch request result
@ -100,10 +101,13 @@ module.exports = {
if (error) {
// NOTE: logging an error here only but actual handling should happen in more sophisticated batch retry handler
// REF: possible mailgun errors https://documentation.mailgun.com/en/latest/api-intro.html#errors
common.logging.warn(new common.errors.GhostError({
let ghostError = new common.errors.GhostError({
err: error,
context: common.i18n.t('errors.services.mega.requestFailed.error')
}));
});
sentry.captureException(ghostError);
common.logging.warn(ghostError);
// NOTE: these are generated variables, so can be regenerated when retry is done
const data = _.omit(batchData, ['recipient-variables']);