mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
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.
This commit is contained in:
parent
48dc1f3f90
commit
6fbb8d6739
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user