Return SubdomainError.BAD_FIELD in route53 backend

Part of #27
This commit is contained in:
Girish Ramakrishnan
2016-09-04 19:46:46 -07:00
parent 2caf57d2c7
commit f96fda325d
+1
View File
@@ -105,6 +105,7 @@ function add(dnsConfig, zoneName, subdomain, type, values, callback) {
route53.changeResourceRecordSets(params, function(error, result) {
if (error && error.code === 'AccessDenied') return callback(new SubdomainError(SubdomainError.ACCESS_DENIED, error.message));
if (error && error.code === 'PriorRequestNotComplete') return callback(new SubdomainError(SubdomainError.STILL_BUSY, error.message));
if (error && error.code === 'InvalidChangeBatch') return callback(new SubdomainError(SubdomainError.BAD_FIELD, error.message));
if (error) return callback(new SubdomainError(SubdomainError.EXTERNAL_ERROR, error.message));
callback(null, result.ChangeInfo.Id);