proto.xmr.tw.view.action.a_sync_wallets: handle SocketError
This commit is contained in:
parent
be17d06708
commit
efb66dec9f
1 changed files with 11 additions and 2 deletions
|
|
@ -83,10 +83,19 @@ class MoneroTwView:
|
|||
class action(TwView.action):
|
||||
|
||||
async def a_sync_wallets(self, parent):
|
||||
from ....util import msg, msg_r
|
||||
from ....util import msg, msg_r, ymsg
|
||||
from ....tw.view import CUR_HOME, ERASE_ALL
|
||||
msg('')
|
||||
op = xmrwallet_op('sync', parent.cfg, None, None, compat_call=True)
|
||||
try:
|
||||
op = xmrwallet_op('sync', parent.cfg, None, None, compat_call=True)
|
||||
except Exception as e:
|
||||
if type(e).__name__ == 'SocketError':
|
||||
import asyncio
|
||||
ymsg(str(e))
|
||||
await asyncio.sleep(2)
|
||||
msg_r(CUR_HOME + ERASE_ALL)
|
||||
return False
|
||||
raise
|
||||
await op.restart_wallet_daemon()
|
||||
await op.main()
|
||||
await parent.get_data()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue