Return BAD_FIELD if dataDir conflicts

This commit is contained in:
Girish Ramakrishnan
2019-09-03 15:17:48 -07:00
parent e117ee2bef
commit de1e218ce9

View File

@@ -380,6 +380,10 @@ function getDuplicateErrorDetails(errorMessage, location, domainObject, portBind
if (portBindings[portName] === parseInt(match[1])) return new AppsError(AppsError.ALREADY_EXISTS, `Port ${match[1]} is reserved`, { portName });
}
if (match[2] === 'dataDir') {
return new AppsError(AppsError.BAD_FIELD, `Data directory ${match[1]} is in use`, { field: 'dataDir' });
}
return new AppsError(AppsError.ALREADY_EXISTS, `${match[2]} '${match[1]}' is in use`);
}