handle error

This commit is contained in:
Girish Ramakrishnan
2016-07-04 23:31:26 -05:00
parent dcc6108da1
commit 70034602c7
+2
View File
@@ -59,6 +59,8 @@ function getHostedZone(dnsConfig, zoneName, callback) {
assert.strictEqual(typeof callback, 'function');
getZoneByName(dnsConfig, zoneName, function (error, zone) {
if (error) return callback(error);
var route53 = new AWS.Route53(getDnsCredentials(dnsConfig));
route53.getHostedZone({ Id: zone.Id }, function (error, result) {
if (error && error.code === 'AccessDenied') return callback(new SubdomainError(SubdomainError.ACCESS_DENIED, error.message));