refactor: use more clear retryer error message (2) (#3227)

This commit is contained in:
Alexandr Garbuzov
2023-09-14 10:47:00 +02:00
committed by GitHub
parent 81f030fd1c
commit ef0ec6e26b
3 changed files with 8 additions and 4 deletions
+4 -1
View File
@@ -26,7 +26,10 @@ const retryer = async (fetcher, variables, retries = 0) => {
throw new CustomError("No GitHub API tokens found", CustomError.NO_TOKENS);
}
if (retries > RETRIES) {
throw new CustomError("Maximum retries exceeded", CustomError.MAX_RETRY);
throw new CustomError(
"Downtime due to GitHub API rate limiting",
CustomError.MAX_RETRY,
);
}
try {
// try to fetch with the first token since RETRIES is 0 index i'm adding +1
+2 -1
View File
@@ -381,7 +381,8 @@ const CONSTANTS = {
};
const SECONDARY_ERROR_MESSAGES = {
MAX_RETRY: "Downtime due to GitHub API rate limiting",
MAX_RETRY:
"You can deploy own instance or wait until public will be no longer limited",
NO_TOKENS:
"Please add an env variable called PAT_1 with your GitHub API token in vercel",
USER_NOT_FOUND: "Make sure the provided username is not an organization",