Skip to content

Commit d6e639b

Browse files
committed
util: provide some useful output strings
1 parent 947f1dd commit d6e639b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

autoload/go/util.vim

+3-5
Original file line numberDiff line numberDiff line change
@@ -193,23 +193,21 @@ function! go#util#Exec(cmd, ...) abort
193193
" CheckBinPath will show a warning for us.
194194
let l:bin = go#path#CheckBinPath(l:bin)
195195
if empty(l:bin)
196-
return ['', 1]
196+
return ['command not found', 1]
197197
endif
198198

199199
" Finally execute the command using the full, resolved path. Do not pass the
200200
" unmodified command as the correct program might not exist in $PATH.
201201
try
202202
return call('s:exec', [[l:bin] + a:cmd[1:]] + a:000)
203203
catch
204-
" TODO(bc): return v:exception as the output here or write it with
205-
" go#util#EchoError?
206-
return ['', 1]
204+
return [v:exception, 1]
207205
endtry
208206
endfunction
209207

210208
function! go#util#ExecInDir(cmd, ...) abort
211209
if !isdirectory(expand("%:p:h"))
212-
return ['', 1]
210+
return ['not a directory', 1]
213211
endif
214212

215213
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '

0 commit comments

Comments
 (0)