From 852a8b89ec16e32cf409b12f1e27d29dabddb1a9 Mon Sep 17 00:00:00 2001 From: Alex Youssefinia Date: Fri, 13 Dec 2024 12:08:32 -0600 Subject: [PATCH] wrap error with try catch for better logging --- services/admin/handlers/batchUpdateCognitoUsers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/admin/handlers/batchUpdateCognitoUsers.js b/services/admin/handlers/batchUpdateCognitoUsers.js index 82f848912..2f0a65652 100644 --- a/services/admin/handlers/batchUpdateCognitoUsers.js +++ b/services/admin/handlers/batchUpdateCognitoUsers.js @@ -47,9 +47,9 @@ async function processCognitoUsers() { roleList = externalUser.roleList; }catch(error) { noRolesCounter ++ - console.log(userEmail + " has no roles") + console.log(userEmail + " has no roles"); } - if (externalUser.roleList && externalUser.roleList.length > 0 && externalUser.roleList[0] != null) { + if (roleList && roleList.length > 0 && roleList[0] != null) { roles = externalUser.roleList.map(role => role.role); hasRolesCounter ++; } else {