public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Catching lua pandoc.pipe() errors
@ 2021-08-19 10:38 William Lupton
       [not found] ` <CAEe_xxhWuGPjZ0Gaw2PBp=VnCjFwOVeMsYr2kN4gxqrSynAP-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: William Lupton @ 2021-08-19 10:38 UTC (permalink / raw)
  To: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 882 bytes --]

All,

I've been using pandoc.pipe() in a lua filter, protected by pcall().
Something like this:

    local succeeded, result = pcall(pandoc.pipe, prog, args, text)

It seems that if 'prog' doesn't exist then pandoc will exit, and pcall()
doesn't catch the error. Is that correct and, if so, is there a reason for
it? (I'd prefer to be able to catch this case, because it will probably
indicate an error on the part of the markdown author.)

Thanks,
William

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxhWuGPjZ0Gaw2PBp%3DVnCjFwOVeMsYr2kN4gxqrSynAP-Q%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 1338 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-20 11:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 10:38 Catching lua pandoc.pipe() errors William Lupton
     [not found] ` <CAEe_xxhWuGPjZ0Gaw2PBp=VnCjFwOVeMsYr2kN4gxqrSynAP-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-20 10:30   ` BPJ
     [not found]     ` <CADAJKhBJJoqjhp=2D5Hze7EFQ-6WLpiEpHa22vbrV3-czD6-FA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-20 11:16       ` William Lupton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).