From f663bb7822cd33f49570acf13e8bf3a5e688d85f Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 13 Feb 2023 18:47:44 +0000 Subject: [PATCH] hotfix: more specific bad response errors --- _common/github.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/_common/github.js b/_common/github.js index 8807927..81056bb 100644 --- a/_common/github.js +++ b/_common/github.js @@ -38,8 +38,14 @@ async function getAllReleases( } let resp = await request(req); - const gHubResp = resp.body; - const all = { + if (!resp.ok) { + console.error('Bad Resp Headers:', resp.headers); + console.error('Bad Resp Body:', resp.body); + throw new Error('the elusive releases BOOGEYMAN strikes again'); + } + + let gHubResp = resp.body; + let all = { releases: [], // todo make this ':baseurl' + ':releasename' download: '', @@ -49,8 +55,8 @@ async function getAllReleases( gHubResp.forEach(transformReleases); } catch (e) { console.error(e.message); - console.error('Headers:', resp.headers); - console.error('Body:', resp.body); + console.error('Error Headers:', resp.headers); + console.error('Error Body:', resp.body); throw e; }