Skip to content

Commit

Permalink
Cleanup unused Error struct - PropagationError (#2547)
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas authored Jan 24, 2025
1 parent 4c77c89 commit 97cf951
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
1 change: 1 addition & 0 deletions opentelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
32 changes: 0 additions & 32 deletions opentelemetry/src/propagation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
//! [`Context`]: crate::Context
use std::collections::HashMap;
use thiserror::Error;

pub mod composite;
pub mod text_map_propagator;
Expand Down Expand Up @@ -62,37 +61,6 @@ impl<S: std::hash::BuildHasher> Extractor for HashMap<String, String, S> {
}
}

/// 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::*;
Expand Down

0 comments on commit 97cf951

Please sign in to comment.