+6
-3
@@ -95504,18 +95504,21 @@ const fetchWithRetry = async (url, options = {}) => {
|
||||
const logRetry = (reason) => {
|
||||
proc_log_1.log.http('fetch', `${options.method} ${url} attempt ${attemptNum} failed with ${reason}`);
|
||||
};
|
||||
proc_log_1.log.http('fetch', `${options.method} ${url} ${base64Encode(JSON.stringify(options.headers || {}))}`);
|
||||
proc_log_1.log.http('fetch', `${options.method} ${url}`);
|
||||
const response = await (0, make_fetch_happen_1.default)(url, {
|
||||
...options,
|
||||
retry: false, // We're handling retries ourselves
|
||||
}).catch((reason) => {
|
||||
logRetry(reason);
|
||||
proc_log_1.log.http('fetch-response', 'caught error', reason);
|
||||
// logRetry(reason);
|
||||
return retry(reason);
|
||||
});
|
||||
if (retryable(response.status)) {
|
||||
logRetry(response.status);
|
||||
proc_log_1.log.http('fetch-response', 'retryable error', response.status, response.text());
|
||||
// logRetry(response.status);
|
||||
return retry(response);
|
||||
}
|
||||
proc_log_1.log.http('fetch-response', response.status);
|
||||
return response;
|
||||
}, retryOpts(options.retry)).catch((err) => {
|
||||
// If we got an actual error, throw it
|
||||
|
||||
Reference in New Issue
Block a user