Skip to content

Commit

Permalink
firenvim.vim: catch settings misconfiguration and turn into message
Browse files Browse the repository at this point in the history
  • Loading branch information
glacambre committed Apr 28, 2024
1 parent 222efad commit cbbd7e8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion autoload/firenvim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,18 @@ function! firenvim#run() abort
let l:result['port'] = l:port
endif

call WriteStdout(a:id, json_encode(result))
let l:response = ''
try
let l:response = json_encode(result)
catch /E474/
call remove(result, 'settings')
if !has_key(result, 'messages')
let result['messages'] = []
endif
call add(result['messages'], 'Error serializing settings:' . v:exception)
let l:response = json_encode(result)
endtry
call WriteStdout(a:id, l:response)
endfunction
if exists('g:firenvim_c')
for data in g:firenvim_i
Expand Down

0 comments on commit cbbd7e8

Please sign in to comment.