GNU bug report logs - #33407
Cuirass is dropping the SQLite error message when rethrowing

Previous Next

Package: guix;

Reported by: Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>

Date: Fri, 16 Nov 2018 17:45:01 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: tracker <at> debbugs.gnu.org
Subject: bug#33407: closed (Cuirass is dropping the SQLite error message
 when rethrowing)
Date: Fri, 16 Nov 2018 20:53:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 16 Nov 2018 21:51:49 +0100
with message-id <874lcgu4nu.fsf <at> gnu.org>
and subject line Re: bug#33407: Cuirass is dropping the SQLite error message when rethrowing
has caused the debbugs.gnu.org bug report #33407,
regarding Cuirass is dropping the SQLite error message when rethrowing
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
33407: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=33407
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>
To: <bug-guix <at> gnu.org>
Subject: Cuirass is dropping the SQLite error message when rethrowing
Date: Fri, 16 Nov 2018 18:43:51 +0100
[Message part 3 (text/plain, inline)]
Hi,

is this a bug or by intention?

In src/cuirass/database.scm, in the db-add-* procedures, we have a
catch-clause like this:

(with-db-critical-section db
  (catch 'sqlite-error
    (lambda ()
      <thunk-body>)
    (lambda (key who code message . rest)
        ;; If we get a unique-constraint-failed error, that means we have
        ;; already inserted the same checkout.  That happens for each input
        ;; that doesn't change between two evaluations.
        (if (= code SQLITE_CONSTRAINT_PRIMARYKEY)
            #f
            (apply throw key who code rest))))))
-------------------------------------^

Here the message is not re-thrown.

It would have made my life easier if I saw this message:

  "NOT NULL constraint failed: Builds.system"

instead of just:

In cuirass/utils.scm:
   115:35  0 (_)
cuirass/utils.scm:115:35: Throw to key `sqlite-error' with args `(#f 1299)'.

Addationally, when adding the message to the apply clause, at least in
an isolated test it will be just thrown without problems.

Björn

[Message part 4 (application/pgp-signature, inline)]
[Message part 5 (message/rfc822, inline)]
From: ludo <at> gnu.org (Ludovic Courtès)
To: Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>
Cc: 33407-done <at> debbugs.gnu.org
Subject: Re: bug#33407: Cuirass is dropping the SQLite error message when
 rethrowing
Date: Fri, 16 Nov 2018 21:51:49 +0100
Hello,

Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de> skribis:

> is this a bug or by intention?
>
> In src/cuirass/database.scm, in the db-add-* procedures, we have a
> catch-clause like this:
>
> (with-db-critical-section db
>   (catch 'sqlite-error
>     (lambda ()
>       <thunk-body>)
>     (lambda (key who code message . rest)
>         ;; If we get a unique-constraint-failed error, that means we have
>         ;; already inserted the same checkout.  That happens for each input
>         ;; that doesn't change between two evaluations.
>         (if (= code SQLITE_CONSTRAINT_PRIMARYKEY)
>             #f
>             (apply throw key who code rest))))))
> -------------------------------------^
>
> Here the message is not re-thrown.
>
> It would have made my life easier if I saw this message:
>
>   "NOT NULL constraint failed: Builds.system"

Oops, good catch!  Fixed in commit
d0ed3341d7201d0332e9aeb0af80e0ec635aeb1e.

I also factorized the exception handler in the previous commit because
there were 3 copies of this bug…

Thanks!

Ludo’.


This bug report was last modified 6 years and 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.