From 292608e6c533fb375628f4e9aaafba4e4fe7b11e Mon Sep 17 00:00:00 2001 From: Interitio Date: Tue, 6 Jan 2026 19:35:41 +1000 Subject: [PATCH] Emergency dump rules on failure --- src/beanify/gui/mainwindow.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/beanify/gui/mainwindow.py b/src/beanify/gui/mainwindow.py index 9e2b3b7..708bcc7 100644 --- a/src/beanify/gui/mainwindow.py +++ b/src/beanify/gui/mainwindow.py @@ -219,9 +219,17 @@ class MainWindow(ThemedTk): self.rebuild_account_cache() def do_save_rules(self): - self.ruleset.save_rules() - self.update_status("Rules saved!") - # TODO: Feedback and confirmation + try: + self.ruleset.save_rules() + self.update_status("Rules saved!") + # TODO: Feedback and confirmation + except Exception: + # Emergency dump + import pickle + + with open("ruleset-crashdump.pickle", "wb") as f: + pickle.dump(self.ruleset.rules, f) + # TODO Raw dump if we can't save for some reason def do_export_txn(self):