aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2018-02-16 13:33:23 -0500
committerJames McCoy <jamessan@jamessan.com>2018-02-16 13:33:23 -0500
commit6fbb8d6739b353752dc405452fb41f9cdf20a0b9 (patch)
tree39b9c71d8735b8a5bcc1afb4179373c8ed4d4952
parent48dc1f3f90c6bbebcaa93ecf3348648f45c45239 (diff)
downloadrneovim-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.vim2
-rw-r--r--runtime/autoload/provider/pythonx.vim2
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