diff --git a/autoload/lsc/dispatch.vim b/autoload/lsc/dispatch.vim index 588d10fd..d1616a58 100644 --- a/autoload/lsc/dispatch.vim +++ b/autoload/lsc/dispatch.vim @@ -28,15 +28,7 @@ function! lsc#dispatch#message(server, message) abort elseif has_key(a:message, 'result') let call_id = a:message['id'] if has_key(s:callbacks, call_id) - try - call s:callbacks[call_id][0](a:message['result']) - catch - call lsc#message#error('Caught '.string(v:exception). - \' while handling '.string(call_id)) - let g:lsc_last_error = v:exception - let g:lsc_last_throwpoint = v:throwpoint - let g:lsc_last_error_message = a:message - endtry + call s:callbacks[call_id][0](a:message['result']) unlet s:callbacks[call_id] endif else diff --git a/autoload/lsc/protocol.vim b/autoload/lsc/protocol.vim index 5e149f35..5b73a4ce 100644 --- a/autoload/lsc/protocol.vim +++ b/autoload/lsc/protocol.vim @@ -76,6 +76,9 @@ function! s:consumeMessage(server) abort call lsc#dispatch#message(a:server, content) catch call lsc#message#error('Error dispatching message: '.string(v:exception)) + let g:lsc_last_error = v:exception + let g:lsc_last_throwpoint = v:throwpoint + let g:lsc_last_error_message = content endtry endif let remaining_message = message[message_end:]