diff options
-rw-r--r-- | lib/lace/compiler.lua | 7 | ||||
-rw-r--r-- | lib/lace/engine.lua | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/lace/compiler.lua b/lib/lace/compiler.lua index 754e680..5d43547 100644 --- a/lib/lace/compiler.lua +++ b/lib/lace/compiler.lua @@ -151,6 +151,13 @@ local function compile_ruleset(ctx, src, cnt) if not ok then return nil, ret end + + if type(msg) == "table" then + -- TODO: Extract position information etc from error and + -- formulate a gorgeous multiline error message. + msg = msg.msg or "Empty error" + end + return ret, msg end diff --git a/lib/lace/engine.lua b/lib/lace/engine.lua index b72db5f..8e93ae0 100644 --- a/lib/lace/engine.lua +++ b/lib/lace/engine.lua @@ -74,6 +74,12 @@ local function run_ruleset(ruleset, exec_context) return false, "Ruleset did not explicitly allow or deny" end + if type(msg) == "table" then + -- TODO: Extract position information etc from error and + -- formulate a gorgeous multiline error message. + msg = msg.msg or "Empty error" + end + return ret, msg end |