From 97cf951396a512418f345ccd65b3532489dff1c8 Mon Sep 17 00:00:00 2001 From: Cijo Thomas Date: Thu, 23 Jan 2025 18:33:01 -0800 Subject: [PATCH] Cleanup unused Error struct - PropagationError (#2547) --- opentelemetry/CHANGELOG.md | 1 + opentelemetry/src/propagation/mod.rs | 32 ---------------------------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/opentelemetry/CHANGELOG.md b/opentelemetry/CHANGELOG.md index 5c5d280c43..2977e271a5 100644 --- a/opentelemetry/CHANGELOG.md +++ b/opentelemetry/CHANGELOG.md @@ -4,6 +4,7 @@ - Bump msrv to 1.75.0. - **Breaking** `opentelemetry::global::shutdown_tracer_provider()` Removed from this crate, should now use `tracer_provider.shutdown()` see [#2369](https://github.com/open-telemetry/opentelemetry-rust/pull/2369) for a migration example. +- *Breaking* Removed unused `opentelemetry::PropagationError` struct. ## 0.27.1 diff --git a/opentelemetry/src/propagation/mod.rs b/opentelemetry/src/propagation/mod.rs index 35005f881a..863517980b 100644 --- a/opentelemetry/src/propagation/mod.rs +++ b/opentelemetry/src/propagation/mod.rs @@ -20,7 +20,6 @@ //! [`Context`]: crate::Context use std::collections::HashMap; -use thiserror::Error; pub mod composite; pub mod text_map_propagator; @@ -62,37 +61,6 @@ impl Extractor for HashMap { } } -/// Error when extracting or injecting context data(i.e propagating) across application boundaries. -#[derive(Error, Debug)] -#[error("Cannot {} from {}, {}", ops, message, propagator_name)] -pub struct PropagationError { - message: &'static str, - // which propagator does this error comes from - propagator_name: &'static str, - // are we extracting or injecting information across application boundaries - ops: &'static str, -} - -impl PropagationError { - /// Error happens when extracting information - pub fn extract(message: &'static str, propagator_name: &'static str) -> Self { - PropagationError { - message, - propagator_name, - ops: "extract", - } - } - - /// Error happens when extracting information - pub fn inject(message: &'static str, propagator_name: &'static str) -> Self { - PropagationError { - message, - propagator_name, - ops: "inject", - } - } -} - #[cfg(test)] mod tests { use super::*;