guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#44321] [PATCH 5/6] transformations: Raise '&formatted-message' exce


From: Ludovic Courtès
Subject: [bug#44321] [PATCH 5/6] transformations: Raise '&formatted-message' exceptions instead of 'leave'.
Date: Mon, 02 Nov 2020 16:48:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

zimoun <zimon.toutoune@gmail.com> skribis:

> On Sat, 31 Oct 2020 at 11:06, Ludovic Courtès <ludo@gnu.org> wrote:
>
>> >> Naive question: what is the difference?  Other said why?  And so why not
>> >> replaces ’leave’ here and there by ’raise’+’formatted-message’?
>> >
>> > Probably Ludo can explain better, but the main difference I see is that
>> > leave (guix diagnostics) calls exit, so the client code now can handle
>> > these errors and it isn't forced to exit.
>>
>> Exactly.  In fact, ‘exit’ throws the 'quit exception, which one could
>> also catch, but it’s still nicer to throw &message or &formatted-message
>> within a module meant to be used as a library.
>
> And so why not replace the 'leave' appearing here and there in the
> code by 'raise'+'formatted-message'?

In (guix scripts …), using ‘leave’ is appropriate.

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]