From 6737ab09d0c9a35c8103ba6fc7ee7ed71c5f3542 Mon Sep 17 00:00:00 2001 From: extremeheat Date: Tue, 29 Nov 2022 00:41:53 +0000 Subject: [PATCH] startVanillaServer: handle server timeout on head request --- tools/startVanillaServer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/startVanillaServer.js b/tools/startVanillaServer.js index 0df2e1b..c6d4769 100644 --- a/tools/startVanillaServer.js +++ b/tools/startVanillaServer.js @@ -57,7 +57,8 @@ async function download (os, version, path = 'bds-') { for (let i = 0; i < 8; i++) { // Check for the latest server build for version (major.minor.patch.BUILD) const u = url(os, `${verStr}.${String(i).padStart(2, '0')}`) debug('Opening', u, Date.now()) - const ret = await head(u) + let ret + try { ret = await head(u) } catch (e) { continue } if (ret.statusCode === 200) { found = u debug('Found server', ret.statusCode)