diff --git a/download_lists.js b/download_lists.js index 9087e0f..db61951 100644 --- a/download_lists.js +++ b/download_lists.js @@ -38,6 +38,7 @@ const downloadLists = async (filename, urls) => { } catch (err) { console.error(`An error occurred while processing ${filename}:\n`, err); console.error("URLs:\n", urls); + throw err; } }; diff --git a/lib/api.js b/lib/api.js index ef4c138..2a83f15 100644 --- a/lib/api.js +++ b/lib/api.js @@ -51,6 +51,7 @@ export const createZeroTrustListsOneByOne = async (items) => { console.log(`Created "${listName}" list - ${totalListNumber} left`); } catch (err) { console.error(`Could not create "${listName}" - ${err.toString()}`); + throw err; } } }; @@ -77,6 +78,7 @@ export const createZeroTrustListsAtOnce = async (items) => { console.log("Created lists successfully"); } catch (err) { console.error(`Error occurred while creating lists - ${err.toString()}`); + throw err; } }; @@ -106,6 +108,7 @@ export const deleteZeroTrustListsOneByOne = async (lists) => { console.log(`Deleted ${name} list - ${totalListNumber} left`); } catch (err) { console.error(`Could not delete ${name} - ${err.toString()}`); + throw err; } } }; @@ -124,6 +127,7 @@ export const deleteZeroTrustListsAtOnce = async (lists) => { console.log("Deleted lists successfully"); } catch (err) { console.error(`Error occurred while deleting lists - ${err.toString()}`); + throw err; } }; @@ -161,6 +165,7 @@ export const createZeroTrustRule = async (wirefilterExpression) => { console.log("Created rule successfully"); } catch (err) { console.error(`Error occurred while creating rule - ${err.toString()}`); + throw err; } }; @@ -180,5 +185,6 @@ export const deleteZeroTrustRule = async (id) => { console.log("Deleted rule successfully"); } catch (err) { console.error(`Error occurred while deleting rule - ${err.toString()}`); + throw err; } }; diff --git a/lib/utils.js b/lib/utils.js index a263a2f..48cee7c 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -87,5 +87,6 @@ export const readFile = async (filePath, onLine) => { console.error( `Error occurred while reading ${basename(filePath)} - ${err.toString()}` ); + throw err; } };