From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23616 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Bj=C3=B6rn_Stenborg?= Newsgroups: gmane.text.pandoc Subject: Signalling error from Python filter Date: Fri, 18 Oct 2019 04:14:47 -0700 (PDT) Message-ID: <3241f1a9-fee2-4203-a070-612fed71c963@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_587_890122531.1571397287517" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="269470"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCDLTYOW7YMBBKN5U3WQKGQEE46QOHA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Oct 18 13:14:51 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ot1-f60.google.com ([209.85.210.60]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1iLQDb-00181t-0E for gtp-pandoc-discuss@m.gmane.org; Fri, 18 Oct 2019 13:14:51 +0200 Original-Received: by mail-ot1-f60.google.com with SMTP id l7sf2778773otf.1 for ; Fri, 18 Oct 2019 04:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=00uNmaN/wZIcuF9BXEbP7LNnEe5AqI9mbq8gr6v55n4=; b=tB7fPY6+YUJRgFkBAdkmoCtQH1iPqTaiZIbevG9iEhjFtsV24cAXMRSTxyY4cMms9R bYZIhQb4nZ4YFnaBMVz3Res2Ondn8hWrrnYU4w3KCMqBUbsHGRzpzoQzm958o34bENib hNEG2Of1pHfc4TicNyB+bZQTiUkMuzH60qV3M8Yuy2neUy0LST4G8e4oFhWipYnsQrcL fQ/DuOgneCArNP+3viJ+KlGHTMgUSmMhpx11uV0nBHdDAU+EiXXqA+1prE7noh+dOn1g xOtA6TqJCI6vTSFKkHKu7TnmH0OMgrwwPgvIYuGyeDneoYaTeKYQB+49glxEyNRDrRtt sHRg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=00uNmaN/wZIcuF9BXEbP7LNnEe5AqI9mbq8gr6v55n4=; b=HejBIJ0tYGMpZFepXsrfjfnz2nEeMCMkoG+YzvY7pbQOWJAcBo2mH1xxOhrA9AcI62 fE4hBa/4rJuCp2OrCID/rFZymFdexKty14oTbb60CxHW6bQnOxJQQyWVwC17nJiiXHDX dCivp4rn75tt9o/geliQzDNopEu1IESyuLEW/suLLTEWDiZ/aabkFVJfzuOUA6asO9GZ j6DoE2taWOWZ+1LSAY7bPunWLIT6lDWwp1pR80QgMiKHSSLI7CqjTE9oiBYDQysABQHg 0UqRygpRpKmKznNU8lFjqXDd+5MtPUIo/6aByMFs8h9R7oEkUlc1rRFJVdue682nkDMk A22Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=00uNmaN/wZIcuF9BXEbP7LNnEe5AqI9mbq8gr6v55n4=; b=TSVn+A1olGJ2faZwZFXpHqHRymCAqEwOEtjeTDoeQz8bqnxBkFergW5tdpzi5EbcaH 0gahHY3bQ89B8BPtxE6Bq2Mcjp0Hh6Km5EPy/nUqg8bfyU8iCmlMSQ9oLKepvzfcrHrD OtMPyPQttHuXdwiUMleVDfmFT5pxVVy6ZPRjhCjzmj5ArqzHwLyAvlipboFa3+1y8evT VcmgihsJYw2WkAr2Y2XW37OZwR3uEhaORjiMWIEK8iJV/kaPzBlnLuKlvEb2lF/kQJtF EnL5okTx+YjMMl9VrRe6dslzk4tr42EcDC46nUbedIffkbGeop/vEYe97UPRJyatOHCp XFpQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAWdfZzBiwAyQNK2sumt/tjEUXomknnIIFqXEVpAz6Cju0MlZ8D0 T8CCStyZnZJiLix9hJ5GHB0= X-Google-Smtp-Source: APXvYqxMVK/kY57itmWutYxdxx7XxUwtEl42iTg6dsuxqy7EY2jIZFcCdl8IjBVfLUCAexVmmS8Osg== X-Received: by 2002:aca:488:: with SMTP id 130mr7709815oie.167.1571397289705; Fri, 18 Oct 2019 04:14:49 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6830:1343:: with SMTP id r3ls1011324otq.2.gmail; Fri, 18 Oct 2019 04:14:48 -0700 (PDT) X-Received: by 2002:a9d:2285:: with SMTP id y5mr7346688ota.129.1571397288257; Fri, 18 Oct 2019 04:14:48 -0700 (PDT) X-Original-Sender: bjorn.stenborg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:23616 Archived-At: ------=_Part_587_890122531.1571397287517 Content-Type: multipart/alternative; boundary="----=_Part_588_682628542.1571397287517" ------=_Part_588_682628542.1571397287517 Content-Type: text/plain; charset="UTF-8" Hi! I'm trying to figure out how best to signal errors from a Python Pandoc filter. If I detect that something goes wrong during filter execution, the goal is to print a descriptive error message to the console and then return an error indication. Unfortunately I can't figure out how to pass that through Pandoc. I could either let my filter print the error to the console and then signal back to Pandoc that document generation should be aborted, or if possible return an error message to Pandoc and have Pandoc propagate it up to the script calling the pandoc binary. But throwing an exception containing the error message leaves me with a not very user-friendly call trace in the console that obscures the real error message. I can't find any real documentation of error codes produced by Pandoc and my Haskell skills are atrocious so I'm having a hard time reading the code I'm afraid. I have an ugly workaround in embedding the error message within a custom "tag" in the generated document and then having the document generation script outside pandoc look for that tag in the generated document and present the error message that it contains and report the document generation as failed to the build system. But this is awkward. Ideas? -- 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/3241f1a9-fee2-4203-a070-612fed71c963%40googlegroups.com. ------=_Part_588_682628542.1571397287517 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi! I'm trying to figure out how best to signal e= rrors from a Python Pandoc filter. If I detect that something goes wrong du= ring filter execution, the goal is to print a descriptive error message to = the console and then return an error indication. Unfortunately I can't = figure out how to pass that through Pandoc.

I coul= d either let my filter print the error to the console and then signal back = to Pandoc that document generation should be aborted, or if possible return= an error message to Pandoc and have Pandoc propagate it up to the script c= alling the pandoc binary. But throwing an exception containing the error me= ssage leaves me with a not very user-friendly call trace in the console tha= t obscures the real error message. I can't find any real documentation = of error codes produced by Pandoc and my Haskell skills are atrocious so I&= #39;m having a hard time reading the code I'm afraid.
I have an ugly workaround in embedding the error message within= a custom "tag" in the generated document and then having the doc= ument generation script outside pandoc look for that tag in the generated d= ocument and present the error message that it contains and report the docum= ent generation as failed to the build system. But this is awkward.

Ideas?

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/3241f1a9-fee2-4203-a070-612fed71c963%40googlegroups.co= m.
------=_Part_588_682628542.1571397287517-- ------=_Part_587_890122531.1571397287517--