mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-12 14:16:55 -05:00
edit: Improve error reporting when $EDITOR is not found.
Reported by Benno Evers <benno@bmevers.de> at <https://lists.gnu.org/archive/html/guix-devel/2015-11/msg00125.html>. * guix/scripts/edit.scm (guix-edit): Wrap 'execl' call in 'catch'. Provide more meaningful error message.
This commit is contained in:
parent
67c920fa5d
commit
650f1615de
1 changed files with 9 additions and 2 deletions
|
@ -79,5 +79,12 @@ (define (guix-edit . args)
|
|||
(leave (_ "source location of package '~a' is unknown~%")
|
||||
(package-full-name package))))
|
||||
packages)
|
||||
(apply execlp (%editor) (%editor)
|
||||
(append-map package->location-specification packages)))))
|
||||
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(apply execlp (%editor) (%editor)
|
||||
(append-map package->location-specification packages)))
|
||||
(lambda args
|
||||
(let ((errno (system-error-errno args)))
|
||||
(leave (_ "failed to launch '~a': ~a~%")
|
||||
(%editor) (strerror errno))))))))
|
||||
|
|
Loading…
Reference in a new issue