From b443539fb3a1c0c6fc4819992ae06183c219ac02 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 12 Jun 2022 15:28:37 +0800 Subject: [PATCH] fix(config): handle error in local config --- autoload/SpaceVim/autocmds.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/autoload/SpaceVim/autocmds.vim b/autoload/SpaceVim/autocmds.vim index d9975e802..2a92a0d78 100644 --- a/autoload/SpaceVim/autocmds.vim +++ b/autoload/SpaceVim/autocmds.vim @@ -198,7 +198,13 @@ function! SpaceVim#autocmds#VimEnter() abort if !filereadable('.SpaceVim.d/init.toml') && filereadable('.SpaceVim.d/init.vim') call SpaceVim#logger#info('loading local conf: .SpaceVim.d/init.vim') - exe 'source .SpaceVim.d/init.vim' + try + exe 'source .SpaceVim.d/init.vim' + catch + call SpaceVim#logger#error('Error occurred while loading the local configuration') + call SpaceVim#logger#error(' exception: ' . v:exception) + call SpaceVim#logger#error(' throwpoint: ' . v:throwpoint) + endtry call SpaceVim#logger#info('finished loading local conf') endif endfunction