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; }