Skip to content

Commit 95fa209

Browse files
authored
Remove unused Error enum (#2546)
1 parent fdf4a63 commit 95fa209

File tree

2 files changed

+1
-46
lines changed

2 files changed

+1
-46
lines changed

opentelemetry-sdk/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ hardcoded limit of 2000 and no ability to change it. This feature will be
268268
re-introduced in a future date, along with the ability to change the cardinality
269269
limit.
270270

271-
271+
- *Breaking* Removed unused `opentelemetry_sdk::Error` enum.
272272
- *Breaking* (Affects custom Exporter authors only) Moved `ExportError` trait from `opentelemetry::export::ExportError` to `opentelemetry_sdk::ExportError`
273273
- *Breaking (Affects custom SpanExporter, SpanProcessor authors only)*: Rename namespaces for Span exporter structs/traits
274274
before:

opentelemetry-sdk/src/error.rs

-45
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,4 @@
11
//! Wrapper for error from trace, logs and metrics part of open telemetry.
2-
use std::sync::PoisonError;
3-
4-
#[cfg(feature = "logs")]
5-
use crate::logs::LogError;
6-
#[cfg(feature = "metrics")]
7-
use crate::metrics::MetricError;
8-
use opentelemetry::propagation::PropagationError;
9-
#[cfg(feature = "trace")]
10-
use opentelemetry::trace::TraceError;
11-
12-
/// Wrapper for error from both tracing and metrics part of open telemetry.
13-
#[derive(thiserror::Error, Debug)]
14-
#[non_exhaustive]
15-
pub enum Error {
16-
#[cfg(feature = "trace")]
17-
#[cfg_attr(docsrs, doc(cfg(feature = "trace")))]
18-
#[error(transparent)]
19-
/// Failed to export traces.
20-
Trace(#[from] TraceError),
21-
#[cfg(feature = "metrics")]
22-
#[cfg_attr(docsrs, doc(cfg(feature = "metrics")))]
23-
#[error(transparent)]
24-
/// An issue raised by the metrics module.
25-
Metric(#[from] MetricError),
26-
27-
#[cfg(feature = "logs")]
28-
#[cfg_attr(docsrs, doc(cfg(feature = "logs")))]
29-
#[error(transparent)]
30-
/// Failed to export logs.
31-
Log(#[from] LogError),
32-
33-
#[error(transparent)]
34-
/// Error happens when injecting and extracting information using propagators.
35-
Propagation(#[from] PropagationError),
36-
37-
#[error("{0}")]
38-
/// Other types of failures not covered by the variants above.
39-
Other(String),
40-
}
41-
42-
impl<T> From<PoisonError<T>> for Error {
43-
fn from(err: PoisonError<T>) -> Self {
44-
Error::Other(err.to_string())
45-
}
46-
}
472
483
/// Trait for errors returned by exporters
494
pub trait ExportError: std::error::Error + Send + Sync + 'static {

0 commit comments

Comments
 (0)