From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OB70HjP9EWE59gAAgWs5BA (envelope-from ) for ; Tue, 10 Aug 2021 06:14:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id kDOQGjP9EWHUPgAAB5/wlQ (envelope-from ) for ; Tue, 10 Aug 2021 04:14:43 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 666CEAFAD for ; Tue, 10 Aug 2021 06:14:42 +0200 (CEST) Received: from localhost ([::1]:36226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDJA0-0005ru-Sd for larch@yhetil.org; Tue, 10 Aug 2021 00:14:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDJ98-0005rj-2D for emacs-orgmode@gnu.org; Tue, 10 Aug 2021 00:13:46 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:39581) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDJ95-0006kQ-3u for emacs-orgmode@gnu.org; Tue, 10 Aug 2021 00:13:44 -0400 Received: by mail-pj1-x1033.google.com with SMTP id u21-20020a17090a8915b02901782c36f543so2431704pjn.4 for ; Mon, 09 Aug 2021 21:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pdx-edu.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=6oEGDf6TYytK7HRKzufAaJxFPSv6h8bdYRKGQklY3SA=; b=H6ynOYnhFNEhJrr1/K5bwxsP9xojGHe+ogYxrds0+jxwQKTLTU0eODL/6ZyYIJbSJu 2cFeka/O9O4YKKjlrprkN3LsSdrFFYeqoVceyl2WT1ERqvu4BrXOiPHO29r32TPEBg3p nZusnHYk7M1iFiRsoOfoBdXoTRXbnZNeGxMJx6rfQIR0WD5AUsq9E9v+NL3VeMnVrX5T 1VpRBy7Ihal616ML4vq7fZMm9xmzzDoP69Zd5obZZCYCOlmnMV6JQgXImMKcjBGZ+7pp MAqzNEJwFaaAGrdN+pQxhvq0Yy85S8Raf4/qOWTg4a3yInWy3+8w7GH8c8mDNnZtKcwK uHLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=6oEGDf6TYytK7HRKzufAaJxFPSv6h8bdYRKGQklY3SA=; b=eASw42AYXLQjBG0hx2cLnF5PIR1Ze4PqCxMYTqdBmMLdx/iiFHKytfW5ZrnQG8/f5E DmyRbRw7n+e2aR9VhkNurg6XpXwjiBjxlrEgp8g/v9DUh2tkHFiZObp/62GSs1lUKRrm 6gFbxMN4Np/g431dCThgUJQP7ra5c6HlWrXiRnO69sXGX2X3WWEwp66KZIXE35Y4iLHx UC1avyMwUeI0jt6Jk21bp3XaJoLkCOJruF7nzauKyHWHcCDMtKoBp5ZgTVq2s8C5gXrB WB9ZZiQXvK3EXYjWsoIuKKRIJ6/GjM/vnLWMZaXjlRTzRMzdHk6rVG35GEf+piB8ZY2M GjWQ== X-Gm-Message-State: AOAM531kK0jYG1opXGrWCyc7lrZdr8NgaTWrGMukJqqo2ntqbw/Q0bie Sr4jywrmQrhnPT/Pc0ZQ4nMb/pszmFWWMaV5hPkDtq+p35fBZV9vQpRDdzlzdbnsGcgy7jrecCj 2POnaTs+KIQSCa6t4maqjWsT2P+Zo/UMA4IPlAzzf8KNNnw/RB+40sl1EbvPr+g== X-Google-Smtp-Source: ABdhPJz7gLVUnWWCC62jAoCqgTztBQ1FLgzkORbJmJcklPHruqc4arkXXbO3T9fBeHDrS2UrJewNhg== X-Received: by 2002:a05:6a00:1803:b029:3cd:d5c1:f718 with SMTP id y3-20020a056a001803b02903cdd5c1f718mr1738061pfa.22.1628568818876; Mon, 09 Aug 2021 21:13:38 -0700 (PDT) Received: from [192.168.0.6] (71-34-68-155.ptld.qwest.net. [71.34.68.155]) by smtp.gmail.com with ESMTPSA id v10sm8606089pfu.100.2021.08.09.21.13.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Aug 2021 21:13:38 -0700 (PDT) To: emacs-orgmode@gnu.org From: James Powell Subject: bug: Error handling in source blocks. Message-ID: <3ac06f2a-c14b-593f-a6e2-8e1c85c19436@pdx.edu> Date: Mon, 9 Aug 2021 21:13:37 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=powellj@pdx.edu; helo=mail-pj1-x1033.google.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, LOTS_OF_MONEY=0.001, MONEY_NOHTML=0.832, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_DOTEDU=1.997 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628568883; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=6oEGDf6TYytK7HRKzufAaJxFPSv6h8bdYRKGQklY3SA=; b=hd0zneaT2APUXw17/PwoN+oBK78ggjbEQXNhrHz09HeFzo8SEjewH+BdS1zE49zQAswjNL XA0XttFMtGyToWarZTi6ZQNgztGaxQZ3sD0qsphNsrbh9jFQd49dxBhzEy+EvidhXvFPZV QCqcL+Iuf4lGjdrriA8D0RQQam2xTeTLYw32NbM9dGS6CtveylLNKMdo8WywEhfw3E/7o8 Q6na96AOS+/dsFYWR+k7b3e22kQsjFsgpaEGlHsHJvtClYDNWRVILA+XQ4OSUPQm+Ovec2 xEfXiWlubsNZdLg2jHrpKRbXj+GMbge4QjYUckh9nwP7x3dytr2+KUo9P3hnOg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628568883; a=rsa-sha256; cv=none; b=KuxpTKP7o4k3G+L1O9RAUo3ben+aS+Epy491GGD1slTna4UcTmzGgdkteO+wUoZgJgMyRi Jj9sGl5amj/ii278X/syXGHCnIZ1w4hPSEq9uzy47FCTtUVgv2QEyTM9wKy2KFTlY+7M2J 5+dgGYcBK0jJinC/tYcv0Emxdw3e/nmLAnZGbRLLBINO1PDU01GSymwOruy3zyv1PspHWt PE1kBSMsUTy9auD+tQ33G8Ti0HdPRle203ebyNrTI9K+XtrqKVgWPuzNg+J+YlCGHCxON2 FOu8I+dSKwnjazO1WVZpzmo25SQRWH2bpdhTveLAbFeGtYJiOqdpEZv5i7V2xw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=pdx-edu.20150623.gappssmtp.com header.s=20150623 header.b=H6ynOYnh; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.61 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pdx-edu.20150623.gappssmtp.com header.s=20150623 header.b=H6ynOYnh; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 666CEAFAD X-Spam-Score: -2.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: OnF3PFi/g3dm   Error handling is important and hard to get right.  Me, I prefer to   treat every warning as an error (-Werror in gcc, "options(warn=2)" in   R, etc).  I want the system to grind to a halt at the least sign of   trouble.   When I write some nonsense into a code block as in this example:   ,----   | : This next code block is intended to trigger an error, because that   | : variable "fffff838293483" with that attribute/member "x8483848"   | : probably does not exist.   | :   | : #+begin_src R :exports both   | : x <- fffff838293483$x8483848   | : #+end_src   | :   | : #+RESULTS:   | :   | : #+begin_src R :exports both :results table :colnames yes   | : require(tidyverse)   | : tribble(~a, ~b, 1, 2)   | : #+end_src   | :   | : #+RESULTS:   | : | a | b |   | : |---+---|   | : | 1 | 2 |   | : #+end_src   `----   which does trigger an error in R   ,----   | Error: object 'fffff838293483' not found   | [traceback follows]   `----   and I do org-to-PDF export, I would like the PDF to be not built and   loud alarm bells to ring bringing the error to my attention.   What happens instead: the document builds from org into PDF with no   indication that anything went wrong at all, except perhaps minor bits   of missing or incorrect text in the PDF file.  The error can easily be   buried in the output as more and later source blocks from the same   document are evaluated.   Likewise, in 'sh',   ,----   | #+begin_src sh :exports results   | exit 1   | #+end_src   `----   Sh exits 1 to indicate an error, so I would like this to ring alarm   bells and fail to produce a PDF on org-to-PDF export.   We might add examples in Java, Python, C++, C along the same lines.   All of these should be in a unit test (because error handling is important).   There do not seem to be any unit tests that exercise error handling in   org-9.4.4.   Exceptions that are thrown in the block should also at least   optionally always and reliably abort the org-to-PDX export and ring   alarm bells.   I would like to see a section in the org manual called "Error handling   in source blocks" that discusses the issue.   I searched for "error handling" at ,   with no results that are relevant.   thank you for your time,   - JP -- James E. Powell, MS Pronouns: he/him/his Applied Physics PhD Candidate Department of Physics Portland State University Home page: http://web.pdx.edu/~powellj Office: SRTC 409B Phone: +1-503-725-8515