@@ -443,7 +443,7 @@ impl PeriodicReaderInner {
443443 futures_executor:: block_on ( self . exporter . export ( & mut rm) )
444444 }
445445
446- fn force_flush ( & self ) -> MetricResult < ( ) > {
446+ fn force_flush ( & self ) -> OTelSdkResult {
447447 // TODO: Better message for this scenario.
448448 // Flush and Shutdown called from 2 threads Flush check shutdown
449449 // flag before shutdown thread sets it. Both threads attempt to send
@@ -460,17 +460,17 @@ impl PeriodicReaderInner {
460460 let ( response_tx, response_rx) = mpsc:: channel ( ) ;
461461 self . message_sender
462462 . send ( Message :: Flush ( response_tx) )
463- . map_err ( |e| MetricError :: Other ( e. to_string ( ) ) ) ?;
463+ . map_err ( |e| OTelSdkError :: InternalFailure ( e. to_string ( ) ) ) ?;
464464
465465 if let Ok ( response) = response_rx. recv ( ) {
466466 // TODO: call exporter's force_flush method.
467467 if response {
468468 Ok ( ( ) )
469469 } else {
470- Err ( MetricError :: Other ( "Failed to flush" . into ( ) ) )
470+ Err ( OTelSdkError :: InternalFailure ( "Failed to flush" . into ( ) ) )
471471 }
472472 } else {
473- Err ( MetricError :: Other ( "Failed to flush" . into ( ) ) )
473+ Err ( OTelSdkError :: InternalFailure ( "Failed to flush" . into ( ) ) )
474474 }
475475 }
476476
@@ -515,7 +515,7 @@ impl MetricReader for PeriodicReader {
515515 self . inner . collect ( rm)
516516 }
517517
518- fn force_flush ( & self ) -> MetricResult < ( ) > {
518+ fn force_flush ( & self ) -> OTelSdkResult {
519519 self . inner . force_flush ( )
520520 }
521521
@@ -546,7 +546,7 @@ mod tests {
546546 error:: { OTelSdkError , OTelSdkResult } ,
547547 metrics:: {
548548 data:: ResourceMetrics , exporter:: PushMetricExporter , reader:: MetricReader ,
549- InMemoryMetricExporter , MetricResult , SdkMeterProvider , Temporality ,
549+ InMemoryMetricExporter , SdkMeterProvider , Temporality ,
550550 } ,
551551 Resource ,
552552 } ;
@@ -592,7 +592,7 @@ mod tests {
592592 }
593593 }
594594
595- async fn force_flush ( & self ) -> MetricResult < ( ) > {
595+ async fn force_flush ( & self ) -> OTelSdkResult {
596596 Ok ( ( ) )
597597 }
598598
@@ -616,7 +616,7 @@ mod tests {
616616 Ok ( ( ) )
617617 }
618618
619- async fn force_flush ( & self ) -> MetricResult < ( ) > {
619+ async fn force_flush ( & self ) -> OTelSdkResult {
620620 Ok ( ( ) )
621621 }
622622
0 commit comments