Skip to content

Commit

Permalink
Upgrade to thiserror 2 (open-telemetry#2406)
Browse files Browse the repository at this point in the history
Co-authored-by: Cijo Thomas <cijo.thomas@gmail.com>
  • Loading branch information
djc and cijothomas authored Dec 10, 2024
1 parent e8ccb01 commit 2573773
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ reqwest = { version = "0.12", default-features = false }
serde = { version = "1.0", default-features = false }
serde_json = "1.0"
temp-env = "0.3.6"
thiserror = { version = "1", default-features = false }
thiserror = { version = "2", default-features = false }
tonic = { version = "0.12.3", default-features = false }
tonic-build = "0.12"
tokio = { version = "1", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/src/logs/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub type LogResult<T> = Result<T, LogError>;
/// Errors returned by the log SDK.
pub enum LogError {
/// Export failed with the error returned by the exporter.
#[error("Exporter {} encountered the following errors: {0}", .0.exporter_name())]
#[error("Exporter {0} encountered the following errors: {name}", name = .0.exporter_name())]
ExportFailed(Box<dyn ExportError>),

/// Export failed to finish after certain period and processor stopped the export.
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/src/metrics/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub enum MetricError {
#[error("Config error {0}")]
Config(String),
/// Fail to export metrics
#[error("Metrics exporter {} failed with {0}", .0.exporter_name())]
#[error("Metrics exporter {0} failed with {name}", name = .0.exporter_name())]
ExportErr(Box<dyn ExportError>),
/// Invalid instrument configuration such invalid instrument name, invalid instrument description, invalid instrument unit, etc.
/// See [spec](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#general-characteristics)
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry/src/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ pub type TraceResult<T> = Result<T, TraceError>;
#[non_exhaustive]
pub enum TraceError {
/// Export failed with the error returned by the exporter
#[error("Exporter {} encountered the following error(s): {0}", .0.exporter_name())]
#[error("Exporter {0} encountered the following error(s): {name}", name = .0.exporter_name())]
ExportFailed(Box<dyn ExportError>),

/// Export failed to finish after certain period and processor stopped the export.
Expand Down

0 comments on commit 2573773

Please sign in to comment.