Skip to content

Commit f2b2d9a

Browse files
authored
Merge pull request #118 from FlowTestAI/cli-logs-1
check for rate limit and max scan limit errors
2 parents b98672a + 6292944 commit f2b2d9a

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

packages/flowtest-cli/bin/axiosClient.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ axiosRetry(axiosClient, {
1717
return retryCount * 1000; // Time interval between retries (1000 ms = 1 second)
1818
},
1919
retryCondition: (error) => {
20-
// Retry on network errors or 5xx server errors
21-
return error.response?.status === 500 || error.code === 'ECONNABORTED';
20+
// Retry on network errors or rate limit errors or 5xx server errors
21+
return error.response?.status === 500 || error.response?.status === 429 || error.code === 'ECONNABORTED';
2222
},
2323
});
2424

packages/flowtest-cli/bin/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,15 @@ const argv = yargs(hideBin(process.argv))
110110
);
111111
console.log(chalk.bold('Build Scan: ') + chalk.dim(`${baseUrl}/scan/${response.data.data[0].id}`));
112112
} catch (error) {
113-
//console.log(error);
113+
if (error?.response) {
114+
if (error.response?.status === 403 || error.response?.status === 429) {
115+
console.log(chalk.red(` ${JSON.stringify(error.response?.data)}`));
116+
}
117+
118+
if (error.response?.status === 500) {
119+
console.log(chalk.red(' Internal Server Error'));
120+
}
121+
}
114122
console.log(chalk.red(` ✕ `) + chalk.dim('Unable to upload build scan'));
115123
}
116124
}

0 commit comments

Comments
 (0)