Skip to content

Commit

Permalink
Merge pull request #3561 from bhcleek/debug/vim-exceptions
Browse files Browse the repository at this point in the history
debug: handle error conditions
  • Loading branch information
bhcleek committed Jun 22, 2023
2 parents 397a9c5 + 91879f6 commit 12de6c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions autoload/go/debug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,9 @@ function! s:sync_breakpoints()
let l:promise = go#promise#New(function('s:rpc_response'), 20000, {})
call s:call_jsonrpc(l:promise.wrapper, 'RPCServer.ListBreakpoints', {'All': v:true})
let l:res = l:promise.await()
if type(l:res) != v:t_dict || !has_key(l:res, 'result') || type(l:res.result) != v:t_dict || !has_key(l:res.result, 'Breakpoints')
call go#util#EchoError('could not list breakpoints')
endif
let l:breakpoints = l:res.result.Breakpoints

let l:signs = s:list_breakpointsigns()
Expand Down Expand Up @@ -798,7 +801,7 @@ function! s:handleRPCResult(resp) abort
" response.
call call(s:state.resultHandlers[l:id], [function('s:check_errors', [a:resp]), a:resp])
catch
throw v:exception
throw substitute(v:exception, '^Vim', '', '')
finally
if has_key(s:state.resultHandlers, l:id)
call remove(s:state.resultHandlers, l:id)
Expand Down Expand Up @@ -1446,7 +1449,7 @@ function! s:handleNextInProgress(res)
endif
endwhile
catch
throw v:exception
throw substitute(v:exception, '^Vim', '', '')
endtry
endfunction

Expand Down

0 comments on commit 12de6c0

Please sign in to comment.