Better debug

This commit is contained in:
Girish Ramakrishnan
2019-04-08 12:23:11 -07:00
parent b8bbd73e07
commit 9fbe209c04
2 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -811,6 +811,8 @@ function upsertDnsRecords(domain, mailFqdn, callback) {
assert.strictEqual(typeof mailFqdn, 'string');
assert.strictEqual(typeof callback, 'function');
debug(`upsertDnsRecords: updating mail dns records of domain ${domain} and mail fqdn ${mailFqdn}`);
maildb.get(domain, function (error, result) {
if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new MailError(MailError.NOT_FOUND));
if (error) return callback(new MailError(MailError.INTERNAL_ERROR, error));
@@ -833,8 +835,6 @@ function upsertDnsRecords(domain, mailFqdn, callback) {
records.push({ subdomain: '', domain: domain, type: 'MX', values: [ '10 ' + mailFqdn + '.' ] });
}
debug('upsertDnsRecords: %j', records);
txtRecordsWithSpf(domain, mailFqdn, function (error, txtRecords) {
if (error) return callback(error);