1
0

kivy: show error when failing to save wallet file backup

related: https://github.com/spesmilo/electrum/issues/6774#issuecomment-856098099
This commit is contained in:
SomberNight
2022-03-14 16:45:07 +01:00
parent 12832a3199
commit 841a701acf

View File

@@ -1373,9 +1373,14 @@ class ElectrumWindow(App, Logger):
if not grant_results or not grant_results[0]:
self.show_error(_("Cannot save backup without STORAGE permission"))
return
try:
backup_dir = util.android_backup_dir()
except OSError as e:
self.logger.exception("Cannot save backup")
self.show_error(f"Cannot save backup: {e!r}")
return
# note: Clock.schedule_once is a hack so that we get called on a non-daemon thread
# (needed for WalletDB.write)
backup_dir = util.android_backup_dir()
Clock.schedule_once(lambda dt: self._save_backup(backup_dir))
request_permissions([Permission.WRITE_EXTERNAL_STORAGE], cb)