From 2346a1c5018d01dcdb7d4e2c7074b145b1802d5e Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 8 Dec 2022 10:16:08 +0100 Subject: [PATCH] better error message when group not found --- src/groups.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/groups.js b/src/groups.js index e958b4d9f..e79d074ae 100644 --- a/src/groups.js +++ b/src/groups.js @@ -162,7 +162,7 @@ async function setMembership(userId, groupIds) { }); const [error] = await safe(database.transaction(queries)); - if (error && error.code === 'ER_NO_REFERENCED_ROW_2') throw new BoxError(BoxError.NOT_FOUND, error.message); + if (error && error.code === 'ER_NO_REFERENCED_ROW_2') throw new BoxError(BoxError.NOT_FOUND, 'Group not found'); if (error && error.code === 'ER_DUP_ENTRY') throw new BoxError(BoxError.CONFLICT, 'Already member'); if (error) throw error; }