mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 11:44:08 +00:00
refactor: catch validation error with pcall
This commit is contained in:
parent
d8d0c2a1f8
commit
a30293ee3b
4 changed files with 22 additions and 59 deletions
|
|
@ -17,7 +17,7 @@ return function()
|
|||
|
||||
for key, case in pairs(cases) do
|
||||
local success, result = pcall(function()
|
||||
validate(case.value, key, error)
|
||||
validate(case.value, key)
|
||||
end)
|
||||
|
||||
if case.expected and not success then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue