-
Notifications
You must be signed in to change notification settings - Fork 114
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
Any way to show Python errors? #59
Comments
It won't be possible, because as far as pandocfilters (in Python) is concerned, it has no error. pandocfilters is for you to modify the JSON. Now, once the JSON is modified (while still being a valid JSON and pandocfilters' job is done), that JSON may no longer be a valid pandoc AST. And hence when pandoc parse the JSON (after obtaining it back from a pandocfilters), pandoc (in Haskell) complain. There's however an issue on pandoc that propose pandoc to emit more meaningful error messages. And I believe it's in @jgm todo list. So I believe this issue should be closed. As a sidenote, you should consider sergiocorreia/panflute: An Pythonic alternative to John MacFarlane's pandocfilters, with extra helper functions. panflute parses the JSON from pandoc to an internal panflute AST which mimics pandoc's AST, which Python classes. So there's a lot of checking in panflute to guarantee your output is correct. While it isn't perfect (in the sense that it can catch all malformed pandoc AST before emitting a JSON), it will provide much more helpful hints for debugging. If you go to pandoc-discuss, @jgm also recommend panflute. |
@benpolinsky errors sent to stderr should be streamed through. |
We could change pandoc so that, if the script returns an error status, stdout is sent to the terminal. |
I'm kind of confused. I thought he's talking about the error in Haskell, not in Python. And if he's talking about printing some debug messages solely for debugging purpose, then would he just pipe it through like
I think may be @benpolinsky should give some Minimal (not-)Working Example for the errors and what you expect. |
Ah apologies for the lack of communication. I haven't been working with Pandoc for the last week or so and my github notifications were out of control. I'll double back and produce an example when I get a chance in the next couple of days. |
Hi - thanks for this library.
I'm wondering if there's a way to capture python errors or output that python would be sending to stdout and display that if something goes wrong, rather than some of the less-than-helpful errors I've been getting back.
Often, there's a
terminateProcess: permission denied (Permission denied)
(when you try to print() something within your py script) or a callstack error:It would be immensely helpful in groking how to use the library's syntax.
The text was updated successfully, but these errors were encountered: