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 unlink(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
await downloadFiles(filePath, urls);
|
try {
|
||||||
console.log(
|
await downloadFiles(filePath, urls);
|
||||||
`Done. The ${filename} file contains merged data from the following list(s):`
|
|
||||||
);
|
console.log(
|
||||||
console.log(
|
`Done. The ${filename} file contains merged data from the following list(s):`
|
||||||
urls.reduce(
|
);
|
||||||
(previous, current, index) => previous + `${index + 1}. ${current}\n`,
|
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) {
|
switch (listType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user