From aed5c911f2e77cda150d53fef2fa8088b727b988 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Wed, 22 Nov 2023 12:28:14 +0000 Subject: [PATCH] Throw error if project name has leading or trailing whitespace (#15842) GitOrigin-RevId: 65dc375535dbab66b7446642c6b2d14c978d3c38 --- .../src/Features/Project/ProjectDetailsHandler.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/services/web/app/src/Features/Project/ProjectDetailsHandler.js b/services/web/app/src/Features/Project/ProjectDetailsHandler.js index 0509ea5982..bcbbba4f06 100644 --- a/services/web/app/src/Features/Project/ProjectDetailsHandler.js +++ b/services/web/app/src/Features/Project/ProjectDetailsHandler.js @@ -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' + ) } }