From 58d2ae6ebf306c40c11f2febe9a375793ab95646 Mon Sep 17 00:00:00 2001 From: Anurag Date: Fri, 13 Jan 2023 13:14:45 +0530 Subject: [PATCH] fix: retryer fixed --- src/common/retryer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/retryer.js b/src/common/retryer.js index e54eedbec6dd5..73833ef85b3a4 100644 --- a/src/common/retryer.js +++ b/src/common/retryer.js @@ -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