diff --git a/src/views/app.js b/src/views/app.js index 82146e149..ab1bee225 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -1603,7 +1603,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' if (result.needsOverwrite) { $scope.clone.needsOverwrite = true; $scope.clone.overwriteDns = true; - return callback({ type: 'exists', fqdn: fqdn, message: 'DNS Record already exists. Confirm that the domain is not in use for services external to Cloudron' }); + return callback({ type: 'externally_exists', fqdn: fqdn, message: 'DNS Record already exists. Confirm that the domain is not in use for services external to Cloudron' }); } callback(); @@ -1629,12 +1629,9 @@ angular.module('Application').controller('AppController', ['$scope', '$location' var errorMessage = error.message.toLowerCase(); if (errorMessage.indexOf('port') !== -1) { $scope.clone.error.port = error.message; - } else if (error.message.indexOf('location') !== -1) { - if (errorMessage.indexOf('primary') !== -1) { - $scope.clone.error.location = error.message; - } else { - $scope.clone.error.secondaryDomain = error.message; - } + } else if (error.message.indexOf('location') !== -1 || error.message.indexOf('subdomain') !== -1) { + // TODO extract fqdn from error message, currently we just set it always to the main location + $scope.clone.error.location = { type: 'internally_exists', fqdn: data.subdomain + '.' + data.domain, message: error.message }; $('#cloneLocationInput').focus(); } else { Client.error(error);