Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua filters: improve error messages for failing filters #6332

Merged
merged 1 commit into from
May 2, 2020

Conversation

tarleb
Copy link
Collaborator

@tarleb tarleb commented May 2, 2020

Print the Lua error properly instead of displaying their show string.

Print the Lua error properly instead of displaying their `show` string.
@tarleb
Copy link
Collaborator Author

tarleb commented May 2, 2020

This makes error output better, but issues remain. E.g.:

-- test.lua
function Pandoc (doc)
  pandoc.mediabag.fetch('does-not-exist.txt')
end

This triggers a PandocResourceNotFound error, which is still just shown:

Error running filter ./test.lua:
PandocResourceNotFound "does-not-exist.txt"
stack traceback:
        [C]: in function 'pandoc.mediabag.fetch'
        ./test.lua:10: in function 'Pandoc'

One solution could be to add a new PandocError constructor PandocErrorStack (NonEmpty PandocError).

@jgm jgm merged commit 0fafe9d into jgm:master May 2, 2020
@jgm
Copy link
Owner

jgm commented May 2, 2020

This is good -- the other case you mention doesn't seem bad to me.

@tarleb tarleb deleted the lua-filter-error-message branch May 3, 2020 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants