catch error when getting status
This commit is contained in:
parent
f457a86bde
commit
287847fcfb
4
index.js
4
index.js
|
|
@ -71,8 +71,12 @@ init();
|
|||
|
||||
async function getAllUsersStatus() {
|
||||
for (let i = 0; i < usernames.length; i++) {
|
||||
try {
|
||||
const userData = await getUserStatus(usernames[i].name, usernames[i].id);
|
||||
usernames[i] = { ...usernames[i], ...userData };
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
if (i === usernames.length - 1) {
|
||||
console.log("Successfully updated all users");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue