Skip to content

Commit 2573773

Browse files
djccijothomas
andauthored
Upgrade to thiserror 2 (#2406)
Co-authored-by: Cijo Thomas <[email protected]>
1 parent e8ccb01 commit 2573773

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ reqwest = { version = "0.12", default-features = false }
3939
serde = { version = "1.0", default-features = false }
4040
serde_json = "1.0"
4141
temp-env = "0.3.6"
42-
thiserror = { version = "1", default-features = false }
42+
thiserror = { version = "2", default-features = false }
4343
tonic = { version = "0.12.3", default-features = false }
4444
tonic-build = "0.12"
4545
tokio = { version = "1", default-features = false }

opentelemetry-sdk/src/logs/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub type LogResult<T> = Result<T, LogError>;
1111
/// Errors returned by the log SDK.
1212
pub enum LogError {
1313
/// Export failed with the error returned by the exporter.
14-
#[error("Exporter {} encountered the following errors: {0}", .0.exporter_name())]
14+
#[error("Exporter {0} encountered the following errors: {name}", name = .0.exporter_name())]
1515
ExportFailed(Box<dyn ExportError>),
1616

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

opentelemetry-sdk/src/metrics/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub enum MetricError {
1818
#[error("Config error {0}")]
1919
Config(String),
2020
/// Fail to export metrics
21-
#[error("Metrics exporter {} failed with {0}", .0.exporter_name())]
21+
#[error("Metrics exporter {0} failed with {name}", name = .0.exporter_name())]
2222
ExportErr(Box<dyn ExportError>),
2323
/// Invalid instrument configuration such invalid instrument name, invalid instrument description, invalid instrument unit, etc.
2424
/// See [spec](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#general-characteristics)

opentelemetry/src/trace/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ pub type TraceResult<T> = Result<T, TraceError>;
205205
#[non_exhaustive]
206206
pub enum TraceError {
207207
/// Export failed with the error returned by the exporter
208-
#[error("Exporter {} encountered the following error(s): {0}", .0.exporter_name())]
208+
#[error("Exporter {0} encountered the following error(s): {name}", name = .0.exporter_name())]
209209
ExportFailed(Box<dyn ExportError>),
210210

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

0 commit comments

Comments
 (0)