From: ludo@gnu.org (Ludovic Courtès)
To: benno@bmevers.de
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] edit: Friendlier error message.
Date: Thu, 05 Nov 2015 12:08:35 +0100 [thread overview]
Message-ID: <874mh0900c.fsf@gnu.org> (raw)
In-Reply-To: <1446676935-11602-1-git-send-email-benno@bmevers.de> (benno@bmevers.de's message of "Wed, 4 Nov 2015 23:42:15 +0100")
benno@bmevers.de skribis:
> From: Benno Evers <benno@bmevers.de>
>
> * 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’.
next prev parent reply other threads:[~2015-11-05 11:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 22:42 [PATCH] edit: Friendlier error message benno
2015-11-05 11:08 ` Ludovic Courtès [this message]
2015-11-07 3:25 ` Andreas Enge
2015-11-07 11:06 ` Ludovic Courtès
2015-11-07 12:24 ` Mathieu Lirzin
2015-11-11 22:01 ` Ludovic Courtès
2015-11-15 4:26 ` Andreas Enge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874mh0900c.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=benno@bmevers.de \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).