mirror of
https://github.com/Nezumi-2711/cloudflare-gateway-pihole-scripts.git
synced 2026-09-22 13:38:37 +00:00
add error logging for list download
This commit is contained in:
+16
-10
@@ -23,16 +23,22 @@ const downloadLists = async (filename, urls) => {
|
||||
await unlink(filePath);
|
||||
}
|
||||
|
||||
await downloadFiles(filePath, urls);
|
||||
console.log(
|
||||
`Done. The ${filename} file contains merged data from the following list(s):`
|
||||
);
|
||||
console.log(
|
||||
urls.reduce(
|
||||
(previous, current, index) => previous + `${index + 1}. ${current}\n`,
|
||||
""
|
||||
)
|
||||
);
|
||||
try {
|
||||
await downloadFiles(filePath, urls);
|
||||
|
||||
console.log(
|
||||
`Done. The ${filename} file contains merged data from the following list(s):`
|
||||
);
|
||||
console.log(
|
||||
urls.reduce(
|
||||
(previous, current, index) => previous + `${index + 1}. ${current}\n`,
|
||||
""
|
||||
)
|
||||
);
|
||||
} catch (err) {
|
||||
console.error(`An error occurred while processing ${filename}:\n`, err);
|
||||
console.error("URLs:\n", urls);
|
||||
}
|
||||
};
|
||||
|
||||
switch (listType) {
|
||||
|
||||
Reference in New Issue
Block a user