Throw error if project name has leading or trailing whitespace (#15842)

GitOrigin-RevId: 65dc375535dbab66b7446642c6b2d14c978d3c38
This commit is contained in:
Alf Eaton 2023-11-22 12:28:14 +00:00 committed by Copybot
parent c4e8fe67ce
commit aed5c911f2

View file

@ -138,17 +138,9 @@ async function validateProjectName(name) {
)
}
if (name !== name.trim()) {
const message = 'Project name cannot start or end with whitespace'
const error = new Errors.InvalidNameError({
message,
info: { name },
})
logger.warn({ error }, message)
// TODO: throw the error, after checking that it won't cause problems
// throw error
throw new Errors.InvalidNameError(
'Project name cannot start or end with whitespace'
)
}
}