From 411f4610175fc6434908545e75f61e5a15768a6c Mon Sep 17 00:00:00 2001 From: Jakub Mucha Date: Mon, 31 Oct 2022 11:17:08 +0000 Subject: [PATCH] chore: improve error handling while fetching metamask releases Signed-off-by: Jakub Mucha --- helpers.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/helpers.js b/helpers.js index 63e38dd11..de028eb74 100644 --- a/helpers.js +++ b/helpers.js @@ -132,9 +132,15 @@ module.exports = { tagName, }; } catch (e) { - throw new Error( - `[getMetamaskReleases] Unable to fetch metamask releases from: ${downloadUrl} with following error:\n${e}`, - ); + if (e.response && e.response.status === 403) { + throw new Error( + `[getMetamaskReleases] Unable to fetch metamask releases from GitHub because you've been rate limited! Please set GH_USERNAME and GH_PAT environment variables to avoid this issue or retry again.`, + ); + } else { + throw new Error( + `[getMetamaskReleases] Unable to fetch metamask releases from GitHub with following error:\n${e}`, + ); + } } }, download: async (url, destination) => {