From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Thompson Subject: Re: improve error message for `guix environment' Date: Mon, 16 Mar 2015 09:04:31 -0400 Message-ID: <87r3sp14bk.fsf@fsf.org> References: <20150316083300.GB15469@venom> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXUhG-0000iy-MF for guix-devel@gnu.org; Mon, 16 Mar 2015 09:04:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXUh9-0004uv-Nz for guix-devel@gnu.org; Mon, 16 Mar 2015 09:04:42 -0400 In-Reply-To: <20150316083300.GB15469@venom> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: =?utf-8?B?VG9tw6HFoSDEjGVjaA==?= , guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tom=C3=A1=C5=A1 =C4=8Cech writes: > When network issue occurs during `guix environment ' call, > the error message is too cryptic: If you can reproduce it, could you please apply this patch and tell me if it makes things any better? The 'with-error-handling' form will catch a bunch of possible errors and print out friendlier messages. Thanks! --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-scripts-environment-Improve-error-messages.patch >From 13113846f0f19b57f271dc71b5cbc606d8c2b68a Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 16 Mar 2015 08:59:59 -0400 Subject: [PATCH] scripts: environment: Improve error messages. * guix/scripts/environment.scm (guix-environmnet): Wrap procedure body with error handling form. --- guix/scripts/environment.scm | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index c96ca35..80ae924 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -220,21 +220,22 @@ packages." (define (handle-argument arg result) (alist-cons 'package arg result)) - (with-store store - (let* ((opts (parse-command-line args %options (list %default-options) - #:argument-handler handle-argument)) - (pure? (assoc-ref opts 'pure)) - (command (assoc-ref opts 'exec)) - (inputs (packages->transitive-inputs - (pick-all (options/resolve-packages opts) 'package))) - (drvs (run-with-store store - (mbegin %store-monad - (set-guile-for-build (default-guile)) - (build-inputs inputs opts))))) - (cond ((assoc-ref opts 'dry-run?) - #t) - ((assoc-ref opts 'search-paths) - (show-search-paths inputs drvs pure?)) - (else - (create-environment inputs drvs pure?) - (system command)))))) + (with-error-handling + (with-store store + (let* ((opts (parse-command-line args %options (list %default-options) + #:argument-handler handle-argument)) + (pure? (assoc-ref opts 'pure)) + (command (assoc-ref opts 'exec)) + (inputs (packages->transitive-inputs + (pick-all (options/resolve-packages opts) 'package))) + (drvs (run-with-store store + (mbegin %store-monad + (set-guile-for-build (default-guile)) + (build-inputs inputs opts))))) + (cond ((assoc-ref opts 'dry-run?) + #t) + ((assoc-ref opts 'search-paths) + (show-search-paths inputs drvs pure?)) + (else + (create-environment inputs drvs pure?) + (system command))))))) -- 2.1.4 --=-=-= Content-Type: text/plain -- David Thompson Web Developer - Free Software Foundation - http://fsf.org GPG Key: 0FF1D807 Support the FSF: https://fsf.org/donate --=-=-=--