tweak logging

Signed-off-by: Brian DeHamer <bdehamer@github.com>
This commit is contained in:
Brian DeHamer
2025-04-09 14:34:02 -07:00
parent 3a105d9b34
commit f4f308e094
Generated Vendored
+6 -3
View File
@@ -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