mirror of
https://github.com/gmbrax/Pilgrim.git
synced 2026-11-09 17:20:17 +00:00
Add a error handling on backup operation
This commit is contained in:
parent
890fc470bb
commit
209099cc5e
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user