mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-22 13:21:38 +00:00
Improve sanitization error messages
This commit is contained in:
parent
2f78d94370
commit
dd30b1686b
1 changed files with 8 additions and 7 deletions
|
|
@ -315,13 +315,14 @@ function API.new(app)
|
||||||
if actions then
|
if actions then
|
||||||
sanitizedActions = {}
|
sanitizedActions = {}
|
||||||
for id, action in actions do
|
for id, action in actions do
|
||||||
assert(type(id) == "string", "Action key must be string")
|
assert(type(id) == "string", "Actions key must be string")
|
||||||
assert(type(action) == "table", "Action must be table")
|
local actionId = "Actions." .. id
|
||||||
assert(type(action.text) == "string", "Action.text must be string")
|
assert(type(action) == "table", actionId .. " must be table")
|
||||||
assert(type(action.style) == "string", "Action.style must be string")
|
assert(type(action.text) == "string", actionId .. ".text must be string")
|
||||||
assert(action.style == "Solid" or action.style == "Bordered", "Action.style must be 'Solid' or 'Bordered'")
|
assert(type(action.style) == "string", actionId .. ".style must be string")
|
||||||
assert(type(action.layoutOrder) == "number", "Action.layoutOrder must be number")
|
assert(action.style == "Solid" or action.style == "Bordered", actionId .. ".style must be 'Solid' or 'Bordered'")
|
||||||
assert(type(action.onClick) == "function", "Action.onClick must be function")
|
assert(type(action.layoutOrder) == "number", actionId .. ".layoutOrder must be number")
|
||||||
|
assert(type(action.onClick) == "function", actionId .. ".onClick must be function")
|
||||||
|
|
||||||
sanitizedActions[id] = {
|
sanitizedActions[id] = {
|
||||||
text = action.text,
|
text = action.text,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue