Handle location change api key invalid error

This commit is contained in:
Johannes Zellner
2019-09-23 19:23:00 +02:00
parent 36299acbfb
commit 3cbb4e3f43

View File

@@ -241,7 +241,15 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
if (overwriteDns) return callback();
Client.getDNSRecords(domain.domain, domain.subdomain, 'A', function (error, result) {
// TODO handle credential errors
if (error && error.statusCode === 424) {
if (data.domain === domain.domain && data.location === domain.subdomain) {
$scope.location.error.location = domain.domain + ' ' + error.message;
} else {
$scope.location.error.alternateDomains = domain.domain + ' ' + error.message;
}
$scope.location.busy = false;
return;
}
if (error) return callback(error);
if (result.length) $scope.location.domainCollisions.push(domain);