guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] edit: Friendlier error message.


From: Ludovic Courtès
Subject: Re: [PATCH] edit: Friendlier error message.
Date: Thu, 05 Nov 2015 12:08:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

address@hidden skribis:

> From: Benno Evers <address@hidden>
>
> * guix/scripts/edit.scm (guix-edit): Check if %editor exists.
> ---
> These are my first lines of guile, so probably there is a much
> better way to do this :D
>
> The previous error message ("execlp: No such file or directory")
> had me confused for a while, though.

Indeed.

You’re doing OK Scheme-wise, no worries!  ;-)

> +    (unless (search-path (parse-path (getenv "PATH")) (%editor))
> +      (leave (_ "Couldn't find editor '~a'. Please check $EDITOR and $PATH.")
> +             (%editor)))

In commit 650f161, I did things slightly differently by catching the
actual ‘execl’ exception and reporting it.  This is more accurate than
using ‘search-path’ because there could be other errors (invalid
permissions, etc.) and possibly TOCTTOU races.

Thank you!

Ludo’.



reply via email to

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