API change: use PandocError for exceptions in Lua subsystem

The PandocError type is used throughout the Lua subsystem, all Lua
functions throw an exception of this type if an error occurs. The
`LuaException` type is removed and no longer exported from
`Text.Pandoc.Lua`. In its place, a new constructor `PandocLuaError` is
added to PandocError.
This commit is contained in:
Albert Krewinkel
2020-04-17 21:52:48 +02:00
parent 2877ca70ec
commit fb54f3d679
17 changed files with 209 additions and 74 deletions
+3 -4
View File
@@ -26,10 +26,9 @@ return {
)
end),
test('non-version string is rejected', function ()
assert.error_matches(
function () Version '11friends' end,
'11friends'
)
local success, msg = pcall(function () Version '11friends' end)
assert.is_falsy(success)
assert.is_truthy(tostring(msg):match('11friends'))
end)
},