From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:59556) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRH1i-0003sZ-Sm for guix-patches@gnu.org; Wed, 22 Apr 2020 11:11:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRH1i-0005zS-GC for guix-patches@gnu.org; Wed, 22 Apr 2020 11:11:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41331) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRH1i-0005yR-3G for guix-patches@gnu.org; Wed, 22 Apr 2020 11:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRH1h-00019j-Tu for guix-patches@gnu.org; Wed, 22 Apr 2020 11:11:01 -0400 Subject: [bug#40643] [PATCH] git-version: Handle invalid arguments gracefully Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200415151824.22988-1-kuba@kadziolka.net> <87v9lx95j7.fsf@gnu.org> <20200421224545.ztr7beu3mqaufyo3@gravity> Date: Wed, 22 Apr 2020 17:10:18 +0200 In-Reply-To: <20200421224545.ztr7beu3mqaufyo3@gravity> ("Jakub \=\?utf-8\?B\?S8SFZHppb8WCa2EiJ3M\=\?\= message of "Wed, 22 Apr 2020 00:45:45 +0200") Message-ID: <87pnbzwo85.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: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Cc: 40643@debbugs.gnu.org Hi, Jakub K=C4=85dzio=C5=82ka skribis: > On Fri, Apr 17, 2020 at 11:16:44PM +0200, Ludovic Court=C3=A8s wrote: >> Hi Jakub, >>=20 >> Jakub K=C4=85dzio=C5=82ka skribis: >>=20 >> > * guix/git-download.scm (git-version): Add a check for commit ID lengt= h. >> > --- >> > If you're curious for the motivation, see [1]. This took a while to >> > debug, so I'm hoping to ease this for the next person who inevitably >> > stumbles upon this. Is a change like this okay? >>=20 >> Yes, I think so. The =E2=80=98error=E2=80=99 procedure is not great, we= would rather >> use =E2=80=98raise=E2=80=99 with a =E2=80=98&message=E2=80=99 condition = (which additionally allows for >> i18n) but it=E2=80=99s no big deal here. > > I considered using raise instead, but I couldn't get it to work > properly. I was getting a "Wrong type (expecting exact integer)" error > instead: > > (raise > (condition (&message > (message "git-version: commit ID unexpectedly short")))) > > Do you know why that might be? It must be because you forgot to include (srfi srfi-34): there are two =E2=80=98raise=E2=80=99 procedure, and in core Guile =E2=80=98raise=E2=80= =99 is about signals, not error conditions. HTH! Ludo=E2=80=99.