mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 01:30:10 +08:00
* Bump @octokit/plugin-retry from 4.0.4 to 5.0.2 Bumps [@octokit/plugin-retry](https://github.com/octokit/plugin-retry.js) from 4.0.4 to 5.0.2. - [Release notes](https://github.com/octokit/plugin-retry.js/releases) - [Commits](https://github.com/octokit/plugin-retry.js/compare/v4.0.4...v5.0.2) --- updated-dependencies: - dependency-name: "@octokit/plugin-retry" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update checked-in dependencies --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Angela P Wen <angelapwen@github.com>
15 lines
490 B
JavaScript
15 lines
490 B
JavaScript
async function errorRequest(state, octokit, error, options) {
|
|
if (!error.request || !error.request.request) {
|
|
throw error;
|
|
}
|
|
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
|
|
const retries = options.request.retries != null ? options.request.retries : state.retries;
|
|
const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
|
|
throw octokit.retry.retryRequest(error, retries, retryAfter);
|
|
}
|
|
throw error;
|
|
}
|
|
export {
|
|
errorRequest
|
|
};
|