From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVGYo-0000nx-Gx for guix-patches@gnu.org; Wed, 12 Jul 2017 08:16:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVGYk-0002s3-Hx for guix-patches@gnu.org; Wed, 12 Jul 2017 08:16:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60386) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVGYk-0002rq-EB for guix-patches@gnu.org; Wed, 12 Jul 2017 08:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dVGYk-0000DB-8z for guix-patches@gnu.org; Wed, 12 Jul 2017 08:16:02 -0400 Subject: [bug#27654] [PATCH] base: Report evaluation error. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170711171615.3992-1-m.othacehe@gmail.com> Date: Wed, 12 Jul 2017 14:15:30 +0200 In-Reply-To: <20170711171615.3992-1-m.othacehe@gmail.com> (Mathieu Othacehe's message of "Tue, 11 Jul 2017 19:16:15 +0200") Message-ID: <87lgntetr1.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Mathieu Othacehe Cc: 27654@debbugs.gnu.org Howdy! Mathieu Othacehe skribis: > * src/cuirass/base.scm (evaluate): Report an error in eof-object? is true= on > data read from port. Otherwise, suppose that data are correct and keep = thins > going. > --- > src/cuirass/base.scm | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm > index f5f80b3..5e0cb0d 100644 > --- a/src/cuirass/base.scm > +++ b/src/cuirass/base.scm > @@ -136,7 +136,13 @@ directory and the sha1 of the top level commit in th= is directory." > (%package-cachedir) > (object->string spec) > (%package-database))) > - (jobs (read port))) > + (jobs (match (read port) > + ;; If an error occured during evaluation report it, > + ;; otherwise, suppose that data read from port are > + ;; correct and keep things going. > + ((? eof-object?) > + (error "Could not evaluate specifications.\n")) > + (data data)))) While we=E2=80=99re at it, let=E2=80=99s avoid =E2=80=98error=E2=80=99 alto= gether (=E2=80=98error=E2=80=99 raises a =E2=80=98misc-error=E2=80=99 exception, which is not very helpful.) What about declaring a specific SRFI-35 error condition type for evaluation errors, and then raising it (with SRFI-34) here? (If you=E2=80= =99re not familiar with SRFI-3[45], there are examples of it in the (guix *) modules.) Thanks, Ludo=E2=80=99.