Skip to content

Commit cb0b0b2

Browse files
committed
refactor(config): dump default values in error
1 parent 9b5be25 commit cb0b0b2

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

fnl/thyme/config/init.fnl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ To stop the forced rollback after repair, please run `:ThymeRollbackUnmount` or
150150
;; NOTE: Do NOT overwrite self with `rawset` to keep
151151
;; __newindex working.
152152
(case (. default-opts k)
153-
nil (error (.. "unexpected option detected: " k))
153+
nil (error (-> "unexpected option detected: %s\ndefault-values:\n%s"
154+
(: :format k (vim.inspect default-opts))))
154155
_ (. config k)))))
155156
:__newindex (when-not debug?
156157
(fn [_ key]

lua/thyme/config/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ local function _15_(_self, k)
121121
local config = get_config()
122122
local _17_ = default_opts[k]
123123
if (_17_ == nil) then
124-
return error(("unexpected option detected: " .. k))
124+
return error(("unexpected option detected: %s\ndefault-values:\n%s"):format(k, vim.inspect(default_opts)))
125125
else
126126
local _0 = _17_
127127
return config[k]

0 commit comments

Comments
 (0)