Fix error handling of one-off runner

This commit is contained in:
Tim Pope 2012-12-25 20:26:45 -05:00
parent 811a514bed
commit 1de922423f

View File

@ -333,9 +333,9 @@ function! s:oneoff.eval(expr, ns) dict abort
let result.value = join(readfile(s:oneoff_pr, 'b'), "\n") let result.value = join(readfile(s:oneoff_pr, 'b'), "\n")
let result.out = join(readfile(s:oneoff_out, 'b'), "\n") let result.out = join(readfile(s:oneoff_out, 'b'), "\n")
let result.err = join(readfile(s:oneoff_err, 'b'), "\n") let result.err = join(readfile(s:oneoff_err, 'b'), "\n")
let result.ex = join(readfile(s:oneoff_err, 'b'), "\n") let result.ex = join(readfile(s:oneoff_ex, 'b'), "\n")
call filter(result, 'v:val !=# ""') call filter(result, '!empty(v:val)')
if v:shell_error && result.ex ==# '' if v:shell_error && get(result, 'ex', '') ==# ''
throw 'Error running Clojure: '.wtf throw 'Error running Clojure: '.wtf
else else
return result return result