From 73c55c450cfbc31777c653980c64656b6980c59d Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Sun, 8 Jan 2023 11:43:18 +0100 Subject: [PATCH] Ignore pool logo download failure as it's not a critical error --- frontend/sync-assets.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/sync-assets.js b/frontend/sync-assets.js index 9c447bf7d..8b43f61e5 100644 --- a/frontend/sync-assets.js +++ b/frontend/sync-assets.js @@ -54,9 +54,13 @@ function downloadMiningPoolLogos() { response.on('end', () => { let response_body = Buffer.concat(chunks_of_data); - const poolLogos = JSON.parse(response_body.toString()); - for (const poolLogo of poolLogos) { - download(`${PATH}/mining-pools/${poolLogo.name}`, poolLogo.download_url); + try { + const poolLogos = JSON.parse(response_body.toString()); + for (const poolLogo of poolLogos) { + download(`${PATH}/mining-pools/${poolLogo.name}`, poolLogo.download_url); + } + } catch (e) { + console.error(`Unable to download mining pool logos. Trying again at next restart. Reason: ${e instanceof Error ? e.message : e}`); } });