Skip to content

Commit 2f074dd

Browse files
committed
rename to InternalFailure
1 parent 2f8756e commit 2f074dd

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

examples/metrics-basic/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ async fn main() {
147147
Ok(_) => println!("MeterProvider shutdown successfully"),
148148
Err(e) => {
149149
match e {
150-
opentelemetry_sdk::error::ShutdownError::Failed(e) => {
150+
opentelemetry_sdk::error::ShutdownError::InternalFailure(e) => {
151151
// This indicates some failure during shutdown.
152152
// Not much to do here, but log the error.
153153
// So users at least know something went wrong,

opentelemetry-otlp/src/exporter/http/metrics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl MetricsClient for OtlpHttpClient {
4848
self.client
4949
.lock()
5050
.map_err(|e| {
51-
ShutdownError::Failed(format!("Internal Error. Failed to acquire lock: {}", e))
51+
ShutdownError::InternalFailure(format!("Internal Error. Failed to acquire lock: {}", e))
5252
})?
5353
.take();
5454

opentelemetry-otlp/src/exporter/tonic/metrics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl MetricsClient for TonicMetricsClient {
9494
self.inner
9595
.lock()
9696
.map_err(|e| {
97-
ShutdownError::Failed(format!("Internal Error. Failed to acquire lock: {}", e))
97+
ShutdownError::InternalFailure(format!("Internal Error. Failed to acquire lock: {}", e))
9898
})?
9999
.take();
100100

opentelemetry-sdk/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub enum ShutdownError {
2424
/// Shutdown failed with an error.
2525
/// This error is returned when the shutdown process failed with an error.
2626
#[error("Shutdown failed: {0}")]
27-
Failed(String),
27+
InternalFailure(String),
2828
}
2929

3030
/// A specialized `Result` type for Shutdown operations.

opentelemetry-sdk/src/metrics/manual_reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl MetricReader for ManualReader {
112112
/// Closes any connections and frees any resources used by the reader.
113113
fn shutdown(&self) -> ShutdownResult {
114114
let mut inner = self.inner.lock().map_err(|e| {
115-
ShutdownError::Failed(format!("Internal Error. Failed to acquire lock: {}", e))
115+
ShutdownError::InternalFailure(format!("Internal Error. Failed to acquire lock: {}", e))
116116
})?;
117117

118118
// Any future call to collect will now return an error.

opentelemetry-sdk/src/metrics/periodic_reader.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,22 +405,22 @@ impl PeriodicReaderInner {
405405
let (response_tx, response_rx) = mpsc::channel();
406406
self.message_sender
407407
.send(Message::Shutdown(response_tx))
408-
.map_err(|e| ShutdownError::Failed(e.to_string()))?;
408+
.map_err(|e| ShutdownError::InternalFailure(e.to_string()))?;
409409

410410
// TODO: Make this timeout configurable.
411411
match response_rx.recv_timeout(Duration::from_secs(5)) {
412412
Ok(response) => {
413413
if response {
414414
Ok(())
415415
} else {
416-
Err(ShutdownError::Failed("Failed to shutdown".into()))
416+
Err(ShutdownError::InternalFailure("Failed to shutdown".into()))
417417
}
418418
}
419419
Err(mpsc::RecvTimeoutError::Timeout) => {
420420
Err(ShutdownError::Timeout(Duration::from_secs(5)))
421421
}
422422
Err(mpsc::RecvTimeoutError::Disconnected) => {
423-
Err(ShutdownError::Failed("Failed to shutdown".into()))
423+
Err(ShutdownError::InternalFailure("Failed to shutdown".into()))
424424
}
425425
}
426426
}

opentelemetry-sdk/src/metrics/pipeline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ impl Pipelines {
661661
if errs.is_empty() {
662662
Ok(())
663663
} else {
664-
Err(crate::error::ShutdownError::Failed(format!("{errs:?}")))
664+
Err(crate::error::ShutdownError::InternalFailure(format!("{errs:?}")))
665665
}
666666
}
667667
}

opentelemetry-sdk/src/testing/metrics/metric_reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl MetricReader for TestMetricReader {
4848
let mut is_shutdown = self.is_shutdown.lock().unwrap();
4949
*is_shutdown = true;
5050
}
51-
result.map_err(|e| crate::error::ShutdownError::Failed(e.to_string()))
51+
result.map_err(|e| crate::error::ShutdownError::InternalFailure(e.to_string()))
5252
}
5353

5454
fn temporality(&self, _kind: InstrumentKind) -> Temporality {

0 commit comments

Comments
 (0)