Skip to content

Commit d92597d

Browse files
committed
feat(http): change error types that are caught
1 parent f4e8a34 commit d92597d

File tree

3 files changed

+3
-3
lines changed
  • exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http

3 files changed

+3
-3
lines changed

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/_log_exporter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def export(
199199
resp.text,
200200
)
201201
return LogExportResult.FAILURE
202-
except Exception as error:
202+
except requests.exceptions.RequestException as error:
203203
_logger.error("Failed to export logs batch reason: %s", error)
204204

205205
if (

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def export(
244244
resp.text,
245245
)
246246
return MetricExportResult.FAILURE
247-
except Exception as error:
247+
except requests.exceptions.RequestException as error:
248248
_logger.error(
249249
"Failed to export metrics batch reason: %s", error
250250
)

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult:
192192
resp.text,
193193
)
194194
return SpanExportResult.FAILURE
195-
except Exception as error:
195+
except requests.exceptions.RequestException as error:
196196
_logger.error("Failed to export span batch reason: %s", error)
197197

198198
if (

0 commit comments

Comments
 (0)