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 {
478478 Err ( Error :: Sync ( err) ) => {
479479 // Retry the sync because we are ahead of the server and we need to push some older
480480 // frames.
481- if let Some ( SyncError :: InvalidPushFrameNoLow ( _, _) ) =
482- err. downcast_ref :: < SyncError > ( )
483- {
481+ if let Some ( SyncError :: InvalidPushFrameNoLow ( _, _) ) = err. downcast_ref ( ) {
484482 tracing:: debug!( "got InvalidPushFrameNo, retrying push" ) ;
485483 self . try_push ( & mut sync_ctx, & conn) . await
486484 } else {
@@ -492,6 +490,22 @@ impl Database {
492490 } else {
493491 self . try_pull ( & mut sync_ctx, & conn) . await
494492 }
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+ } )
495509 }
496510
497511 #[ cfg( feature = "sync" ) ]
You can’t perform that action at this time.
0 commit comments