aboutsummaryrefslogtreecommitdiff
path: root/pandoc-lua-engine/src/Text
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2022-10-05 21:49:33 +0200
committerAlbert Krewinkel <[email protected]>2022-10-05 21:53:03 +0200
commit48ab7a17cf14588f36c601bf9aca2f74e801f2a9 (patch)
tree65639d7bd9ca1ffed0e3d646a84f509708afcff1 /pandoc-lua-engine/src/Text
parentb05c380f6ff4375cbc27955653fd31310ff2f94d (diff)
Lua: produce more informative error messages for pandoc errors
Errors are reported in Lua in the same words in which they would be reported in the terminal.
Diffstat (limited to 'pandoc-lua-engine/src/Text')
-rw-r--r--pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/PandocError.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/PandocError.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/PandocError.hs
index 7f83f2fc0..7feba2d45 100644
--- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/PandocError.hs
+++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/PandocError.hs
@@ -19,9 +19,9 @@ module Text.Pandoc.Lua.Marshal.PandocError
)
where
-import HsLua (LuaError, Peeker, Pusher, liftLua, pushString)
+import HsLua (LuaError, Peeker, Pusher, liftLua, pushText)
import HsLua.Packaging
-import Text.Pandoc.Error (PandocError (PandocLuaError))
+import Text.Pandoc.Error (PandocError (PandocLuaError), renderError)
import qualified HsLua as Lua
import qualified Text.Pandoc.UTF8 as UTF8
@@ -30,9 +30,9 @@ import qualified Text.Pandoc.UTF8 as UTF8
typePandocError :: LuaError e => DocumentedType e PandocError
typePandocError = deftype "PandocError"
[ operation Tostring $ defun "__tostring"
- ### liftPure (show @PandocError)
+ ### liftPure renderError
<#> udparam typePandocError "obj" "PandocError object"
- =#> functionResult pushString "string" "string representation of error."
+ =#> functionResult pushText "string" "string representation of error."
]
mempty -- no members