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