Add a error handling on backup operation

This commit is contained in:
Gustavo Henrique Santos Souza de Miranda
2025-07-24 19:05:55 -03:00
parent 890fc470bb
commit 209099cc5e
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -306,7 +306,13 @@ class DiaryListScreen(Screen):
session = self.app.service_manager.get_session()
if session:
backup_service = BackupService(session)
result = backup_service.create_backup()
result_operation,result_data = backup_service.create_backup()
else:
self.notify("You must be logged in to perform this action")
self.notify(f"Backup result: {result}")
if result_operation:
self.notify(f"Backup result: {result_data}")
else:
self.notify(f"Error performing backup {result_data}")
raise Exception("Error performing backup")
self.app.exit()