public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BPJ <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Catching lua pandoc.pipe() errors
Date: Fri, 20 Aug 2021 12:30:43 +0200	[thread overview]
Message-ID: <CADAJKhBJJoqjhp=2D5Hze7EFQ-6WLpiEpHa22vbrV3-czD6-FA@mail.gmail.com> (raw)
In-Reply-To: <CAEe_xxhWuGPjZ0Gaw2PBp=VnCjFwOVeMsYr2kN4gxqrSynAP-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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

Might it work to call which through a pipe, either pandoc's or lua's
io.popen() if the latter isn't disabled? That means two pipings rather than
one, but you will know if the program you want to run exists.


Den tors 19 aug. 2021 12:39William Lupton <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org>
skrev:

> 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
> <https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxhWuGPjZ0Gaw2PBp%3DVnCjFwOVeMsYr2kN4gxqrSynAP-Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CADAJKhBJJoqjhp%3D2D5Hze7EFQ-6WLpiEpHa22vbrV3-czD6-FA%40mail.gmail.com.

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

  parent reply	other threads:[~2021-08-20 10:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 10:38 William Lupton
     [not found] ` <CAEe_xxhWuGPjZ0Gaw2PBp=VnCjFwOVeMsYr2kN4gxqrSynAP-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-20 10:30   ` BPJ [this message]
     [not found]     ` <CADAJKhBJJoqjhp=2D5Hze7EFQ-6WLpiEpHa22vbrV3-czD6-FA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-08-20 11:16       ` William Lupton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADAJKhBJJoqjhp=2D5Hze7EFQ-6WLpiEpHa22vbrV3-czD6-FA@mail.gmail.com' \
    --to=bpj-j3h7gcxpsitlodktgw+v6w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).