Skip to content

Commit

Permalink
Merge pull request #132 from mrrfv/ratelimit-text-change
Browse files Browse the repository at this point in the history
Clarify the meaning of the request error/ratelimit message
  • Loading branch information
mrrfv authored Sep 26, 2024
2 parents fdd45e8 + f084847 commit a230411
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ const request = async (url, options) => {
return data;
} catch (error) {
attempts++;
console.warn(`An error occured while making a web request: "${error}", retrying. Attempt ${attempts} of ${maxAttempts}.`)
console.warn(`An error occured while making a web request: "${error}", retrying. Attempt ${attempts} of ${maxAttempts}.\nTHIS IS NORMAL IN MOST CIRCUMSTANCES. Refrain from reporting this as a bug unless the script doesn't automatically recover after several attempts.`);
if(attempts >= maxAttempts) {
// Send a message to the Discord webhook if it exists
await notifyWebhook(`An HTTP error has occurred (${response ? response.status : "unknown status"}) while making a web request. Please check the logs for further details.`);
throw new Error(`HTTP error! Status: ${response.status} - ${ (data && 'errors' in data) ? data.errors[0].message : data } - ${error}`);
}
await wait(5000);
await wait(8000);
}
}
};
Expand Down

0 comments on commit a230411

Please sign in to comment.