@contextlib.contextmanager
def HandleServerException(display=True, truncate=False):
 try:
  try:
   (yield)
  except UnknownExtraConf as e:
   if vimsupport.Confirm(str(e)):
    _LoadExtraConfFile(e.extra_conf_file)
   else:
    _IgnoreExtraConfFile(e.extra_conf_file)
 except Exception as e:
  _logger.exception(u'Error while handling server response')
  if display:
   DisplayServerException(e, truncate)

@ contextlib . contextmanager def HandleServerException ( display = True , truncate = False ) : try : try : ( yield ) except UnknownExtraConf as e : if vimsupport . Confirm ( str ( e ) ) : _LoadExtraConfFile ( e . extra_conf_file ) else : _IgnoreExtraConfFile ( e . extra_conf_file ) except Exception as e : _logger . exception ( u'Error while handling server response' ) if display : DisplayServerException ( e , truncate )
catch any exception raised through server communication .