better error handling

This commit is contained in:
lilydjwg 2020-12-23 15:40:21 +08:00
parent 056f8c580d
commit d619809504
2 changed files with 9 additions and 4 deletions

View file

@ -18,7 +18,10 @@ class FcitxComm():
def deactivate(self):
self.fcitx.Deactivate()
Fcitx = FcitxComm()
try:
Fcitx = FcitxComm()
except dbus.exceptions.DBusException as e:
vim.command('echohl WarningMsg | echom "fcitx.vim not loaded: %s" | echohl NONE' % e)
def may_reconnect(func):
@functools.wraps(func)