@@ -367,29 +367,35 @@ def migration_progress(self, skip_ui: bool = False):
367
367
pb .setCancelButton (None )
368
368
self .body_wrapper_01 .layout ().addWidget (pb )
369
369
370
- iterator = FunctionIterator (self .migration_iterator )
371
- iterator .value .connect (
372
- lambda x : (
373
- pb .setLabelText (f"<h4>{ x } </h4>" ),
374
- self .update_sql_value_ui (show_msg_box = False )
375
- if x == Translations ["json_migration.checking_for_parity" ]
376
- else (),
377
- self .update_parity_ui ()
378
- if x == Translations ["json_migration.checking_for_parity" ]
379
- else (),
370
+ try :
371
+ iterator = FunctionIterator (self .migration_iterator )
372
+ iterator .value .connect (
373
+ lambda x : (
374
+ pb .setLabelText (f"<h4>{ x } </h4>" ),
375
+ self .update_sql_value_ui (show_msg_box = False )
376
+ if x == Translations ["json_migration.checking_for_parity" ]
377
+ else (),
378
+ self .update_parity_ui ()
379
+ if x == Translations ["json_migration.checking_for_parity" ]
380
+ else (),
381
+ )
380
382
)
381
- )
382
- r = CustomRunnable ( iterator . run )
383
- r . done . connect (
384
- lambda : (
385
- self . update_sql_value_ui ( show_msg_box = not skip_ui ),
386
- pb .setMinimum (1 ),
387
- pb . setValue ( 1 ),
388
- # Enable the finish button
389
- self . stack [ 1 ]. buttons [ 4 ]. setDisabled ( False ), # type: ignore
383
+ r = CustomRunnable ( iterator . run )
384
+ r . done . connect (
385
+ lambda : (
386
+ self . update_sql_value_ui ( show_msg_box = not skip_ui ),
387
+ pb . setMinimum ( 1 ),
388
+ pb .setValue (1 ),
389
+ # Enable the finish button
390
+ self . stack [ 1 ]. buttons [ 4 ]. setDisabled ( False ), # type: ignore
391
+ )
390
392
)
391
- )
392
- QThreadPool .globalInstance ().start (r )
393
+ QThreadPool .globalInstance ().start (r )
394
+ except Exception as e :
395
+ logger .error ("[MigrationModal][Iterator] Error:" , error = e )
396
+ pb .setLabelText (f"<h4>{ type (e ).__name__ } </h4>" )
397
+ pb .setMinimum (1 )
398
+ pb .setValue (1 )
393
399
394
400
def migration_iterator (self ):
395
401
"""Iterate over the library migration process."""
0 commit comments