Add location conflict error code

This commit is contained in:
Girish Ramakrishnan
2019-09-02 12:42:28 -07:00
parent b9ee127775
commit a2f8203a42
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -152,7 +152,6 @@ AppsError.ALREADY_EXISTS = 'Already Exists';
AppsError.NOT_FOUND = 'Not Found';
AppsError.BAD_FIELD = 'Bad Field';
AppsError.BAD_STATE = 'Bad State';
AppsError.PORT_RESERVED = 'Port Reserved';
AppsError.PORT_CONFLICT = 'Port Conflict';
AppsError.LOCATION_CONFLICT = 'Location Conflict';
AppsError.PLAN_LIMIT = 'Plan Limit';
@@ -201,7 +200,7 @@ function validatePortBindings(portBindings, manifest) {
const hostPort = portBindings[portName];
if (!Number.isInteger(hostPort)) return new AppsError(AppsError.BAD_FIELD, `${hostPort} is not an integer`);
if (RESERVED_PORTS.indexOf(hostPort) !== -1) return new AppsError(AppsError.PORT_RESERVED, `Port ${hostPort} is reserved.`);
if (RESERVED_PORTS.indexOf(hostPort) !== -1) return new AppsError(AppsError.PORT_CONFLICT, `Port ${hostPort} is reserved.`);
if (hostPort <= 1023 || hostPort > 65535) return new AppsError(AppsError.BAD_FIELD, `${hostPort} is not in permitted range`);
}