handle API error

This commit is contained in:
Viet Huynh
2023-09-09 21:24:02 +07:00
parent 53803edc6e
commit 61d6c03704
2 changed files with 10 additions and 2 deletions
+6 -2
View File
@@ -63,8 +63,12 @@ const createZeroTrustListsAtOnce = async (items) => {
listNumber++;
}
await Promise.all(requests);
console.log(`Created ${totalListNumber} lists`);
try {
await Promise.all(requests);
console.log(`Created ${totalListNumber} lists`);
} catch (err) {
console.error(`Error occurred while creating lists - ${err.toString()}`);
}
};
/**