Skip to content

Commit

Permalink
OpenTelemetry exporter use correct error code when there is a network…
Browse files Browse the repository at this point in the history
… issue (#13205)

* Adding correct error code when there is an issue in core-http

* Initial commit
  • Loading branch information
hectorhdzg authored Jan 13, 2021
1 parent 7cd87e9 commit 79cf938
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,7 @@ export class AzureMonitorTraceExporter implements SpanExporter {

private _isNetworkError(error: Error): boolean {
if (error instanceof RestError) {
if (
error &&
error.code &&
(error.code === "ETIMEDOUT" ||
error.code === "ESOCKETTIMEDOUT" ||
error.code === "ECONNREFUSED" ||
error.code === "ECONNRESET" ||
error.code === "ENOENT")
) {
if (error && error.code && error.code === "REQUEST_SEND_ERROR") {
return true;
}
}
Expand Down

0 comments on commit 79cf938

Please sign in to comment.