File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 12
12
//! - [`ChainTipChange`]: a read-only channel that can asynchronously await chain tip changes.
13
13
14
14
use std:: {
15
+ convert,
15
16
future:: Future ,
16
17
pin:: Pin ,
17
18
sync:: Arc ,
@@ -753,7 +754,12 @@ impl Service<Request> for StateService {
753
754
async move {
754
755
rsp_rx
755
756
. await
756
- . expect ( "sender is not dropped" )
757
+ . map_err ( |_recv_error| {
758
+ BoxError :: from ( "block was dropped from the state CommitBlock queue" )
759
+ } )
760
+ // TODO: replace with Result::flatten once it stabilises
761
+ // https://github.com/rust-lang/rust/issues/70142
762
+ . and_then ( convert:: identity)
757
763
. map ( Response :: Committed )
758
764
. map_err ( Into :: into)
759
765
}
@@ -773,7 +779,14 @@ impl Service<Request> for StateService {
773
779
async move {
774
780
rsp_rx
775
781
. await
776
- . expect ( "sender is not dropped" )
782
+ . map_err ( |_recv_error| {
783
+ BoxError :: from (
784
+ "block was dropped from the state CommitFinalizedBlock queue" ,
785
+ )
786
+ } )
787
+ // TODO: replace with Result::flatten once it stabilises
788
+ // https://github.com/rust-lang/rust/issues/70142
789
+ . and_then ( convert:: identity)
777
790
. map ( Response :: Committed )
778
791
. map_err ( Into :: into)
779
792
}
You can’t perform that action at this time.
0 commit comments