Skip to content

Commit

Permalink
Avoid masking handling errors as decoding errors
Browse files Browse the repository at this point in the history
This came up in #16 where an exception during message handling gets
swallowed and the error is about decoding.
  • Loading branch information
natebosch committed Jun 27, 2017
1 parent 1d685fe commit 33b6259
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/lsc/protocol.vim
Expand Up @@ -40,10 +40,10 @@ function! lsc#protocol#consumeMessage(ch_id) abort
try
let content = json_decode(payload)
if type(content) != v:t_dict | throw 1 | endif
call lsc#dispatch#message(content)
catch
call lsc#util#error('Could not decode message: '.payload)
endtry
if exists('l:content') | call lsc#dispatch#message(content) | endif
let remaining_message = message[message_end:]
call lsc#server#setBuffer(a:ch_id, remaining_message)
if remaining_message != ''
Expand Down

0 comments on commit 33b6259

Please sign in to comment.