fix: handle exceptions at init

dev-assets
Pocco81 3 years ago
parent a04903c372
commit 4824779f4d

@ -190,8 +190,7 @@ function M.apply(cs)
local good, color_scheme = require("catppuccino.core.cs").get_color_scheme(cs)
if not good then
print(color_scheme) -- error message
return
return false, color_scheme -- error message
end
_G.cpt = color_scheme
@ -204,7 +203,7 @@ function M.apply(cs)
_G.cpc = nil
_G.cpt = nil
return theme
return true, theme
end
return M

@ -9,7 +9,14 @@ local function load(args)
catppuccino.before_loading()
end
utils.load(require("catppuccino.core.mapper").apply(args))
local good, theme = require("catppuccino.core.mapper").apply(args)
if not good then
print(theme) -- error message
return
end
utils.load(theme)
if (catppuccino.after_loading ~= nil) then
catppuccino.after_loading()

Loading…
Cancel
Save