mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-03 17:24:29 +00: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:
		@@ -81,7 +81,7 @@ function! provider#node#Require(host) abort
 | 
				
			|||||||
  catch
 | 
					  catch
 | 
				
			||||||
    echomsg v:throwpoint
 | 
					    echomsg v:throwpoint
 | 
				
			||||||
    echomsg v:exception
 | 
					    echomsg v:exception
 | 
				
			||||||
    for row in job.stderr
 | 
					    for row in get(job, 'stderr', [])
 | 
				
			||||||
      echomsg row
 | 
					      echomsg row
 | 
				
			||||||
    endfor
 | 
					    endfor
 | 
				
			||||||
  endtry
 | 
					  endtry
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,7 +29,7 @@ function! provider#pythonx#Require(host) abort
 | 
				
			|||||||
  catch
 | 
					  catch
 | 
				
			||||||
    echomsg v:throwpoint
 | 
					    echomsg v:throwpoint
 | 
				
			||||||
    echomsg v:exception
 | 
					    echomsg v:exception
 | 
				
			||||||
    for row in job.stderr
 | 
					    for row in get(job, 'stderr', [])
 | 
				
			||||||
      echomsg row
 | 
					      echomsg row
 | 
				
			||||||
    endfor
 | 
					    endfor
 | 
				
			||||||
  endtry
 | 
					  endtry
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user