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

improve error message when attempting to run a JSON filter #6211

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

cscheid
Copy link
Collaborator

@cscheid cscheid commented Jul 14, 2023

Context: a Lua filter from an extension doesn't have a file extension. We call it like this:

filters:
  - some_filter_extension

This makes sense because the user doesn't know the internal name of the Lua file in the filter. However, this notation is ambiguous. If the extension doesn't exist (or, as commonly happens, is misspelled), we interpret the filter as a JSON filter. In this case, our current error message is not very helpful.

This PR improves the situation.

Example:

FATAL (/Users/cscheid/repos/github/quarto-dev/quarto-cli/src/resources/filters/./common/wrapped-filter.lua:128) An error occurred:
Could not run /Users/cscheid/repos/github/wch/shinycomponent/quarto/shinygrid as a JSON filter.
Please make sure the file exists and is executable.

Did you intend 'shinygrid' as a Lua filter in an extension?
If so, make sure you've spelled the name of the extension correctly.

The original Pandoc error follows below.
Error running filter /Users/cscheid/repos/github/wch/shinycomponent/quarto/shinygrid:
Could not find executable /Users/cscheid/repos/github/wch/shinycomponent/quarto/shinygrid

@cscheid cscheid merged commit 13c11b1 into main Jul 14, 2023
7 checks passed
@cscheid cscheid deleted the enhancement/json-filter-error-message branch July 14, 2023 15:15
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.

1 participant