Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug: handle error conditions #3561

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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