Move MailError to BoxError
This commit is contained in:
@@ -25,6 +25,7 @@ exports = module.exports = {
|
||||
};
|
||||
|
||||
var assert = require('assert'),
|
||||
BoxError = require('./boxerror.js'),
|
||||
constants = require('./constants.js'),
|
||||
custom = require('./custom.js'),
|
||||
debug = require('debug')('box:mailer'),
|
||||
@@ -93,7 +94,7 @@ function sendMail(mailOptions, callback) {
|
||||
}));
|
||||
|
||||
transport.sendMail(mailOptions, function (error) {
|
||||
if (error) return callback(error);
|
||||
if (error) return callback(new BoxError(BoxError.EXTERNAL_ERROR, error));
|
||||
|
||||
debug(`Email "${mailOptions.subject}" sent to ${mailOptions.to}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user