Tighten error handling of lein autoconnect

Fixes #28.
This commit is contained in:
Tim Pope 2013-01-06 23:18:15 -05:00
parent 3ee902f648
commit 0ff9cd710d
2 changed files with 3 additions and 3 deletions

View File

@ -233,7 +233,7 @@ function! s:nrepl_call(payload) dict abort
if !exists('err') if !exists('err')
return nrepl#foreplay_connection#bdecode('l'.out.'e') return nrepl#foreplay_connection#bdecode('l'.out.'e')
endif endif
throw 'nREPL: '.err throw 'nREPL Connection Error: '.err
endfunction endfunction
finish finish
@ -289,7 +289,7 @@ EOF
if !exists('err') if !exists('err')
return nrepl#foreplay_connection#bdecode('l'.out.'e') return nrepl#foreplay_connection#bdecode('l'.out.'e')
endif endif
throw 'nREPL: '.err throw 'nREPL Connection Error: '.err
endfunction endfunction
finish finish

View File

@ -997,7 +997,7 @@ function! s:leiningen_connect()
let s:leiningen_repl_ports[b:leiningen_root] = getftime(portfile) let s:leiningen_repl_ports[b:leiningen_root] = getftime(portfile)
try try
call s:register_connection(nrepl#foreplay_connection#open(port), b:leiningen_root) call s:register_connection(nrepl#foreplay_connection#open(port), b:leiningen_root)
catch /^nREPL: .*[Cc]onnection/ catch /^nREPL Connection Error:/
call delete(portfile) call delete(portfile)
endtry endtry
endif endif