1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 00:30:05 +08:00

Print error if user's bootstrap was unsuccessful (#4093)

This commit is contained in:
Jakub Nowak 2021-02-16 12:49:38 +01:00 committed by GitHub
parent 934d975ff3
commit 93adceec29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -171,12 +171,25 @@ function! SpaceVim#autocmds#VimEnter() abort
if !empty(get(g:, '_spacevim_bootstrap_after', ''))
try
call call(g:_spacevim_bootstrap_after, [])
let g:_spacevim_bootstrap_after_success = 1
catch
call SpaceVim#logger#error('failed to call bootstrap_after function: ' . g:_spacevim_bootstrap_after)
call SpaceVim#logger#error(' exception: ' . v:exception)
call SpaceVim#logger#error(' throwpoint: ' . v:throwpoint)
let g:_spacevim_bootstrap_after_success = 0
endtry
endif
if !get(g:, '_spacevim_bootstrap_before_success', 1)
echohl Error
echom 'bootstrap_before function failed to execute. Check `SPC h L` for errors.'
echohl None
endif
if !get(g:, '_spacevim_bootstrap_after_success', 1)
echohl Error
echom 'bootstrap_after function failed to execute. Check `SPC h L` for errors.'
echohl None
endif
endfunction
function! s:disable_welcome() abort

View File

@ -160,10 +160,12 @@ function! SpaceVim#custom#apply(config, type) abort
if !empty(bootstrap_before)
try
call call(bootstrap_before, [])
let g:_spacevim_bootstrap_before_success = 1
catch
call SpaceVim#logger#error('failed to call bootstrap_before function: ' . bootstrap_before)
call SpaceVim#logger#error(' exception: ' . v:exception)
call SpaceVim#logger#error(' throwpoint: ' . v:throwpoint)
let g:_spacevim_bootstrap_before_success = 0
endtry
endif
endif