File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -478,9 +478,7 @@ impl Database {
478
478
Err ( Error :: Sync ( err) ) => {
479
479
// Retry the sync because we are ahead of the server and we need to push some older
480
480
// frames.
481
- if let Some ( SyncError :: InvalidPushFrameNoLow ( _, _) ) =
482
- err. downcast_ref :: < SyncError > ( )
483
- {
481
+ if let Some ( SyncError :: InvalidPushFrameNoLow ( _, _) ) = err. downcast_ref ( ) {
484
482
tracing:: debug!( "got InvalidPushFrameNo, retrying push" ) ;
485
483
self . try_push ( & mut sync_ctx, & conn) . await
486
484
} else {
@@ -492,6 +490,22 @@ impl Database {
492
490
} else {
493
491
self . try_pull ( & mut sync_ctx, & conn) . await
494
492
}
493
+ . or_else ( |err| {
494
+ let Error :: Sync ( err) = err else {
495
+ return Err ( err) ;
496
+ } ;
497
+
498
+ // TODO(levy): upcasting should be done *only* at the API boundary, doing this in
499
+ // internal code just sucks.
500
+ let Some ( SyncError :: HttpDispatch ( _) ) = err. downcast_ref ( ) else {
501
+ return Err ( Error :: Sync ( err) ) ;
502
+ } ;
503
+
504
+ Ok ( crate :: database:: Replicated {
505
+ frame_no : None ,
506
+ frames_synced : 0 ,
507
+ } )
508
+ } )
495
509
}
496
510
497
511
#[ cfg( feature = "sync" ) ]
You can’t perform that action at this time.
0 commit comments