fix: retryer fixed (#2400)

This commit is contained in:
Anurag Hazra
2023-01-13 13:16:33 +05:30
committed by GitHub
parent 4b8198fa21
commit 0ff426d258
+2 -1
View File
@@ -45,8 +45,9 @@ const retryer = async (fetcher, variables, retries = 0) => {
// prettier-ignore
// also checking for bad credentials if any tokens gets invalidated
const isBadCredential = err.response.data && err.response.data.message === "Bad credentials";
const isAccountSuspended = err.response.data && err.response.data.message === "Sorry. Your account was suspended.";
if (isBadCredential) {
if (isBadCredential || isAccountSuspended) {
logger.log(`PAT_${retries + 1} Failed`);
retries++;
// directly return from the function