[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: [Babel] Handling of errors when using Ledger
From: |
Dan Davison |
Subject: |
[Orgmode] Re: [Babel] Handling of errors when using Ledger |
Date: |
Thu, 07 Oct 2010 14:36:59 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Sébastien Vauban <address@hidden>
writes:
[...]
> Let's imagine I thought (which was the case at some point) I needed to enclose
> the parameters between quotes:
>
> #+srcname: quoted-params
> #+begin_src ledger :cmdline "reg unknown" :noweb yes :session
> <<data>>
> #+end_src
>
> #+results: quoted-params
>
> Nothing is returned. In fact, I would expect an error to be thrown, the same
[...]
> I don't know if this is a common problem (to Org-Babel) or only to the Ledger
> part of it, but I think *we* should somehow improve the handling of errors.
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 =#+results-err= block which would be what's shown on
> =/dev/stderr=, 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