do not use field inside error object
This commit is contained in:
@@ -451,17 +451,19 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
|
||||
Client.configureApp($scope.app.id, 'location', data, function (error) {
|
||||
if (error && (error.statusCode === 409 || error.statusCode === 400)) {
|
||||
if ((error.subdomain && error.domain) || error.field === 'location') {
|
||||
if (data.domain === error.domain && data.subdomain === error.subdomain) { // the primary
|
||||
if (error.message.indexOf('location') !== -1) {
|
||||
if (error.message.indexOf('primary') !== -1) {
|
||||
$scope.location.error.location = error.message;
|
||||
$scope.locationForm.$setPristine();
|
||||
} else { // FIXME: check error in aliasDomains
|
||||
} else if (error.message.indexOf('secondary') !== -1) {
|
||||
$scope.location.error.secondaryDomain = error.message;
|
||||
} else if (error.message.indexOf('redirect') !== -1) {
|
||||
$scope.location.error.redirectDomains = error.message;
|
||||
} else if (error.message.indexOf('alias') !== -1) {
|
||||
$scope.location.error.aliasDomains = error.message;
|
||||
}
|
||||
} else if (error.portName || error.field === 'portBindings') {
|
||||
} else if (error.message.indexOf('portBinding') !== -1) {
|
||||
$scope.location.error.port = error.message;
|
||||
} else if (error.message.indexOf('secondaryDomain') !== -1) {
|
||||
$scope.location.error.secondaryDomain = error.message;
|
||||
}
|
||||
|
||||
$scope.location.busy = false;
|
||||
|
||||
Reference in New Issue
Block a user