diff --git a/src/apps.js b/src/apps.js index fee042274..071d7fd81 100644 --- a/src/apps.js +++ b/src/apps.js @@ -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`); }