From 975f9f985d715f85fc3f0f75b76392e4afb03b99 Mon Sep 17 00:00:00 2001 From: Tatsuki Sugiura Date: Thu, 19 Oct 2023 23:06:30 +0900 Subject: [PATCH] fix: stop to check response body and check return code; https://github.com/open-telemetry/opentelemetry-js/pull/3542#discussion_r1219900394 --- .../otlp-exporter-base/src/platform/browser/util.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/experimental/packages/otlp-exporter-base/src/platform/browser/util.ts b/experimental/packages/otlp-exporter-base/src/platform/browser/util.ts index 1c6d60ca7b..2d2de4c846 100644 --- a/experimental/packages/otlp-exporter-base/src/platform/browser/util.ts +++ b/experimental/packages/otlp-exporter-base/src/platform/browser/util.ts @@ -200,13 +200,9 @@ export function sendWithFetch( body, }).then( response => { - if (response.ok) { - response.text().then( - t => diag.debug('Request Success', t), - () => {} - ); + if (response.status >= 200 && response.status <= 299) { return; - } else if (isExportRetryable(response.status) && retries > 0) { + } else if (response.status && isExportRetryable(response.status) && retries > 0) { let retryTime: number; minDelay = DEFAULT_EXPORT_BACKOFF_MULTIPLIER * minDelay;