Skip to content
Snippets Groups Projects
Unverified Commit be10c29d authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix(http): improve error handling (#17587)

parent 244f40fb
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,7 @@ exports[`logger/err-serializer got sanitize http error 1`] = ` ...@@ -28,6 +28,7 @@ exports[`logger/err-serializer got sanitize http error 1`] = `
"content-type": "application/json", "content-type": "application/json",
}, },
"httpVersion": null, "httpVersion": null,
"retryCount": 0,
"statusCode": 412, "statusCode": 412,
"statusMessage": "Precondition Failed", "statusMessage": "Precondition Failed",
}, },
......
...@@ -85,6 +85,7 @@ export default function prepareError(err: Error): Record<string, unknown> { ...@@ -85,6 +85,7 @@ export default function prepareError(err: Error): Record<string, unknown> {
err.name === 'TimeoutError' ? undefined : clone(err.response.body), err.name === 'TimeoutError' ? undefined : clone(err.response.body),
headers: clone(err.response.headers), headers: clone(err.response.headers),
httpVersion: err.response.httpVersion, httpVersion: err.response.httpVersion,
retryCount: err.response.retryCount,
}; };
} }
} }
......
...@@ -67,6 +67,7 @@ function handleGotError( ...@@ -67,6 +67,7 @@ function handleGotError(
message = String(body.message); message = String(body.message);
} }
if ( if (
err.code === 'ERR_HTTP2_STREAM_ERROR' ||
err.code === 'ENOTFOUND' || err.code === 'ENOTFOUND' ||
err.code === 'ETIMEDOUT' || err.code === 'ETIMEDOUT' ||
err.code === 'EAI_AGAIN' || err.code === 'EAI_AGAIN' ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment