Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup unused Error struct - PropagationError #2547

Merged
merged 3 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading