diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-04-13 16:43:52 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-04-13 17:21:28 -0300 |
commit | 54bd3843384af34c895942acb32ca3996d5cb614 (patch) | |
tree | 577ab13c7491880c7cdfdff54b1bbfa7341a7ab5 | |
parent | d119fb7f1d77588e54004fa90745608c64f41a0a (diff) | |
download | rneovim-54bd3843384af34c895942acb32ca3996d5cb614.tar.gz rneovim-54bd3843384af34c895942acb32ca3996d5cb614.tar.bz2 rneovim-54bd3843384af34c895942acb32ca3996d5cb614.zip |
runtime: Handle failures while loading individual remote plugins
The s:RegistrationCommands functions will now test the type of the "specs" rpc
call. If it's not a list, then the plugin failed to load and is skipped
-rw-r--r-- | runtime/autoload/remote/host.vim | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/runtime/autoload/remote/host.vim b/runtime/autoload/remote/host.vim index b07593f39b..ebbd85b6e6 100644 --- a/runtime/autoload/remote/host.vim +++ b/runtime/autoload/remote/host.vim @@ -133,6 +133,11 @@ function! s:RegistrationCommands(host) let lines = [] for path in paths let specs = rpcrequest(channel, 'specs', path) + if type(specs) != type([]) + " host didn't return a spec list, indicates a failure while loading a + " plugin + continue + endif call add(lines, "call remote#host#RegisterPlugin('".a:host \ ."', '".path."', [") for spec in specs @@ -244,9 +249,10 @@ function! s:RequirePythonHost(name) endif catch endtry - throw 'Failed to load python host.' . - \ " Try upgrading the Neovim python module with 'pip install --upgrade neovim'" . - \ " or see ':help nvim-python'." + throw 'Failed to load python host. You can try to see what happened ' . + \ 'by starting Neovim with $NVIM_PYTHON_PYTHON_LOG and opening '. + \ 'the generated log file. Also, the host stderr will be available '. + \ 'in Neovim log, so it may contain useful information.' endfunction call remote#host#Register('python', function('s:RequirePythonHost')) |