Handle 404 in case subdomain does not exist on delete attempt

This commit is contained in:
Johannes Zellner
2015-10-09 15:21:17 +02:00
parent 686af3d4cf
commit 18b667ffb6
+1
View File
@@ -65,6 +65,7 @@ function delSubdomain(zoneName, subdomain, type, value, callback) {
.end(function (error, result) {
if (error) return callback(error);
if (result.status === 420) return callback(new SubdomainError(SubdomainError.STILL_BUSY));
if (result.status === 404) return callback(new SubdomainError(SubdomainError.NOT_FOUND));
if (result.status !== 204) return callback(new SubdomainError(SubdomainError.EXTERNAL_ERROR, util.format('%s %j', result.status, result.body)));
return callback(null);