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
|
|
};
|