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

Updated test email to throw error for failed requests

no issue
This commit is contained in:
Rish 2019-11-18 13:24:28 +05:30
parent a64fab7e69
commit baccbb4942

View file

@ -60,7 +60,13 @@ module.exports = {
}
const post = model.toJSON();
const {emails = []} = frame.data;
return mega.mega.sendTestEmail(post, emails);
const response = await mega.mega.sendTestEmail(post, emails);
if (response && response[0] && response[0].error) {
throw new common.errors.EmailError({
message: response[0].error.message
});
}
return response;
}
}
};