Skip to content
Snippets Groups Projects
Commit cc50beb0 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(http): use request for retryCount

parent 97fb2878
No related branches found
No related tags found
No related merge requests found
...@@ -85,13 +85,13 @@ async function gotTask<T>( ...@@ -85,13 +85,13 @@ async function gotTask<T>(
if (error instanceof RequestError) { if (error instanceof RequestError) {
statusCode = statusCode =
error.response?.statusCode ?? error.response?.statusCode ??
/* istanbul ignore next: can't be tested */ 0; /* istanbul ignore next: can't be tested */ -1;
duration = duration =
error.timings?.phases.total ?? error.timings?.phases.total ??
/* istanbul ignore next: can't be tested */ 0; /* istanbul ignore next: can't be tested */ -1;
const method = options.method?.toUpperCase() ?? 'GET'; const method = options.method?.toUpperCase() ?? 'GET';
const code = error.code ?? 'UNKNOWN'; const code = error.code ?? 'UNKNOWN';
const retryCount = error.response?.retryCount ?? -1; const retryCount = error.request?.retryCount ?? -1;
logger.debug( logger.debug(
`${method} ${url} = (code=${code}, statusCode=${statusCode} retryCount=${retryCount}, duration=${duration})` `${method} ${url} = (code=${code}, statusCode=${statusCode} retryCount=${retryCount}, duration=${duration})`
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment