diff --git a/src/dns/route53.js b/src/dns/route53.js index 8efc564a7..bf17b52ed 100644 --- a/src/dns/route53.js +++ b/src/dns/route53.js @@ -228,7 +228,7 @@ function verifyDnsConfig(dnsConfig, domain, ip, callback) { dns.resolveNs(domain, function (error, nameservers) { if (error && error.code === 'ENOTFOUND') return callback(new SubdomainError(SubdomainError.BAD_FIELD, 'Unable to resolve nameservers for this domain')); - if (error || !nameservers) return callback(error || new Error('Unable to get nameservers')); + if (error || !nameservers) return callback(new SubdomainError(SubdomainError.BAD_FIELD, error ? error.message : 'Unable to get nameservers')); getHostedZone(credentials, domain, function (error, zone) { if (error) return callback(error);