Handle failure in CardLayout/accept()

This commit is contained in:
RumovZ 2021-05-25 20:58:43 +02:00
parent e9309c5378
commit db9594818a

View file

@ -30,6 +30,7 @@ from aqt.utils import (
saveSplitter, saveSplitter,
shortcut, shortcut,
showInfo, showInfo,
showWarning,
tooltip, tooltip,
tr, tr,
) )
@ -791,7 +792,7 @@ class CardLayout(QDialog):
update_notetype_legacy(parent=self.mw, notetype=self.model).success( update_notetype_legacy(parent=self.mw, notetype=self.model).success(
on_done on_done
).run_in_background() ).failure(lambda e: showWarning(str(e))).run_in_background()
def reject(self) -> None: def reject(self) -> None:
if self.change_tracker.changed(): if self.change_tracker.changed():