Add location conflict error code
This commit is contained in:
+1
-2
@@ -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`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user