diff options
author | James McCoy <jamessan@jamessan.com> | 2018-02-16 13:33:23 -0500 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2018-02-16 13:33:23 -0500 |
commit | 6fbb8d6739b353752dc405452fb41f9cdf20a0b9 (patch) | |
tree | 39b9c71d8735b8a5bcc1afb4179373c8ed4d4952 | |
parent | 48dc1f3f90c6bbebcaa93ecf3348648f45c45239 (diff) | |
download | rneovim-6fbb8d6739b353752dc405452fb41f9cdf20a0b9.tar.gz rneovim-6fbb8d6739b353752dc405452fb41f9cdf20a0b9.tar.bz2 rneovim-6fbb8d6739b353752dc405452fb41f9cdf20a0b9.zip |
provider: Safely access job.stderr in #Require
If `jobstart()` fails, then the subsequent `rpcrequest()` will throw due
to an invalid channel id. This causes `job.stderr` not to exist, so we
throw another exception when trying to dump the job's stderr.
Error detected while processing function remote#define#AutocmdBootstrap[1]..remote#host#Require[10]..provider#pythonx#Require:
line 22:
E716: Key not present in Dictionary: stderr
This obfuscates the actual problem.
-rw-r--r-- | runtime/autoload/provider/node.vim | 2 | ||||
-rw-r--r-- | runtime/autoload/provider/pythonx.vim | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/runtime/autoload/provider/node.vim b/runtime/autoload/provider/node.vim index 3dde18022e..493eecf433 100644 --- a/runtime/autoload/provider/node.vim +++ b/runtime/autoload/provider/node.vim @@ -81,7 +81,7 @@ function! provider#node#Require(host) abort catch echomsg v:throwpoint echomsg v:exception - for row in job.stderr + for row in get(job, 'stderr', []) echomsg row endfor endtry diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index 1c77eabe23..f9aa09b16b 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -29,7 +29,7 @@ function! provider#pythonx#Require(host) abort catch echomsg v:throwpoint echomsg v:exception - for row in job.stderr + for row in get(job, 'stderr', []) echomsg row endfor endtry |