Skip to content

Commit

Permalink
chore: improve error handling while fetching metamask releases
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Mucha <jakub.mucha@icloud.com>
  • Loading branch information
drptbl committed Oct 31, 2022
1 parent 52b5930 commit 411f461
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 411f461

Please sign in to comment.