From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [Babel] Handling of errors when using Ledger Date: Thu, 07 Oct 2010 14:36:59 +0100 Message-ID: <87sk0inmys.fsf@stats.ox.ac.uk> References: <877hhudxor.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=60383 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3qfW-00039l-O9 for emacs-orgmode@gnu.org; Thu, 07 Oct 2010 09:38:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P3qfU-0003ZZ-Ui for emacs-orgmode@gnu.org; Thu, 07 Oct 2010 09:37:57 -0400 Received: from plane.gmane.org ([80.91.229.3]:39370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P3qfU-0003Z8-NF for emacs-orgmode@gnu.org; Thu, 07 Oct 2010 09:37:56 -0400 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1P3qfK-0007E0-7s for emacs-orgmode@gnu.org; Thu, 07 Oct 2010 15:37:46 +0200 In-Reply-To: <877hhudxor.fsf@mundaneum.com> (=?utf-8?Q?=22S=C3=A9bastien?= Vauban"'s message of "Thu, 07 Oct 2010 13:55:32 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?Q?S=C3=A9bastien?= Vauban Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org S=C3=A9bastien Vauban writes: [...] > Let's imagine I thought (which was the case at some point) I needed to en= close > the parameters between quotes: > > #+srcname: quoted-params > #+begin_src ledger :cmdline "reg unknown" :noweb yes :session > <> > #+end_src > > #+results: quoted-params > > Nothing is returned. In fact, I would expect an error to be thrown, the s= ame [...] > I don't know if this is a common problem (to Org-Babel) or only to the Le= dger > part of it, but I think *we* should somehow improve the handling of error= s. Hi Seb, Babel has a standard mechanism for evaluating shell commands and displaying errors if any. It is the function `org-babel-eval' in ob-eval.el. The problem is that ob-ledger is not using this mechanism. Would you be interested in fixing this? Basically what is required is to re-implement `org-babel-execute:ledger' using `org-babel-eval'. (There are plenty of examples in the other langauges to follow.) Please don't worry if you are too busy though. > - Maybe displaying a =3D#+results-err=3D block which would be what's show= n on > =3D/dev/stderr=3D, when not void? I've vaguely wondered about this sort of thing in the past. The thing is that that's getting close to the idea of proper exception handling in Org-babel. That would certainly be interesting, and I'm sure we would welcome well thought-through proposals on the topic. It would need to deal with errors occurring in a block anywhere in the `call tree' (e.g. what happens when block A is evaluated and A references blocks B and C, and B references D and an error occurs in D) > - And having a way to display the error code would be a plus. That will happen automatically when ledger is converted to use `org-babel-eval'. Dan > > Best regards, > Seb