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:
James McCoy 2018-02-16 13:33:23 -05:00
parent 48dc1f3f90
commit 6fbb8d6739
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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