Lua: fix rendering of Lua errors in Lua

Otherwise the `Error running Lua` message can be prepended multiple
times.
This commit is contained in:
Albert Krewinkel
2022-10-16 21:38:25 +02:00
parent c8ef079c0f
commit af2b4c47bb
@@ -30,7 +30,9 @@ import qualified Text.Pandoc.UTF8 as UTF8
typePandocError :: LuaError e => DocumentedType e PandocError
typePandocError = deftype "PandocError"
[ operation Tostring $ defun "__tostring"
### liftPure renderError
### liftPure (\case
PandocLuaError e -> e
err -> renderError err)
<#> udparam typePandocError "obj" "PandocError object"
=#> functionResult pushText "string" "string representation of error."
]