mirror of
https://github.com/tpope/vim-rhubarb.git
synced 2025-12-07 04:34:27 +08:00
Better error reporting
This commit is contained in:
@@ -174,10 +174,14 @@ function! rhubarb#omnifunc(findstart,base) abort
|
|||||||
return map(rhubarb#repo_request('collaborators'), '"@".v:val.login')
|
return map(rhubarb#repo_request('collaborators'), '"@".v:val.login')
|
||||||
else
|
else
|
||||||
let prefix = (a:base =~# '^#' ? '#' : s:repo_homepage().'/issues/')
|
let prefix = (a:base =~# '^#' ? '#' : s:repo_homepage().'/issues/')
|
||||||
return map(rhubarb#repo_request('issues'), '{"word": prefix.v:val.number, "menu": v:val.title, "info": substitute(v:val.body,"\\r","","g")}')
|
let issues = rhubarb#repo_request('issues')
|
||||||
|
if type(issues) == type({})
|
||||||
|
call s:throw(get(issues, 'message', 'unknown error'))
|
||||||
|
endif
|
||||||
|
return map(issues, '{"word": prefix.v:val.number, "menu": v:val.title, "info": substitute(v:val.body,"\\r","","g")}')
|
||||||
endif
|
endif
|
||||||
catch /^\%(fugitive\|rhubarb\):/
|
catch /^\%(fugitive\|rhubarb\):/
|
||||||
return v:errmsg
|
echoerr v:errmsg
|
||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user