Browse Source
refact: use `xpcall` instead of `pcall`
to load configuration files, this should allow us to send a better traceback if something goes wrong
my-config
NTBBloodbath
3 years ago
No known key found for this signature in database
GPG Key ID: 18D6730BC846AAC5
4 changed files with
4 additions and
4 deletions
-
lua/doom/core/config/init.lua
-
lua/doom/core/config/modules.lua
-
lua/doom/core/config/userplugins.lua
-
lua/doom/extras/logging/init.lua
|
|
@ -430,7 +430,7 @@ if ok then |
|
|
|
M.config = ret.config |
|
|
|
M.source = ret.source |
|
|
|
else |
|
|
|
ok, ret = pcall(dofile, system.doom_configs_root .. "/doom_config.lua") |
|
|
|
ok, ret = xpcall(dofile, debug.traceback, system.doom_configs_root .. "/doom_config.lua") |
|
|
|
if ok then |
|
|
|
M.config = ret.config |
|
|
|
M.source = ret.source |
|
|
|
|
|
@ -93,7 +93,7 @@ if ok then |
|
|
|
M.modules = ret.modules |
|
|
|
M.source = ret.source |
|
|
|
else |
|
|
|
ok, ret = pcall(dofile, system.doom_configs_root .. "/doom_modules.lua") |
|
|
|
ok, ret = xpcall(dofile, debug.traceback, system.doom_configs_root .. "/doom_modules.lua") |
|
|
|
if ok then |
|
|
|
M.modules = ret.modules |
|
|
|
M.source = ret.source |
|
|
|
|
|
@ -23,7 +23,7 @@ if ok then |
|
|
|
M.plugins = ret.plugins |
|
|
|
M.source = ret.source |
|
|
|
else |
|
|
|
ok, ret = pcall(dofile, system.doom_configs_root .. "/doom_userplugins.lua") |
|
|
|
ok, ret = xpcall(dofile, debug.traceback, system.doom_configs_root .. "/doom_userplugins.lua") |
|
|
|
if ok then |
|
|
|
M.plugins = ret.plugins |
|
|
|
M.source = ret.source |
|
|
|
|
|
@ -18,7 +18,7 @@ local ok, ret = pcall(require, "doom_config") |
|
|
|
if ok then |
|
|
|
logging_level = ret.config.doom.logging or logging_level |
|
|
|
else |
|
|
|
ok, ret = pcall(dofile, system.doom_configs_root .. "/doom_config.lua") |
|
|
|
ok, ret = xpcall(dofile, debug.traceback, system.doom_configs_root .. "/doom_config.lua") |
|
|
|
if ok then |
|
|
|
logging_level = ret.config.doom.logging or logging_level |
|
|
|
end |
|
|
|