2023-06-13 12:39:20 -07:00
|
|
|
async function errorRequest(state, octokit, error, options) {
|
|
|
|
|
if (!error.request || !error.request.request) {
|
2020-09-21 11:06:21 +01:00
|
|
|
throw error;
|
2023-06-13 12:39:20 -07:00
|
|
|
}
|
|
|
|
|
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;
|
2020-09-21 11:06:21 +01:00
|
|
|
}
|
2023-06-13 12:39:20 -07:00
|
|
|
export {
|
|
|
|
|
errorRequest
|
|
|
|
|
};
|