unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33407: Cuirass is dropping the SQLite error message when rethrowing
@ 2018-11-16 17:43 Björn Höfling
  2018-11-16 20:51 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Björn Höfling @ 2018-11-16 17:43 UTC (permalink / raw)
  To: 33407

[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#33407: Cuirass is dropping the SQLite error message when rethrowing
  2018-11-16 17:43 bug#33407: Cuirass is dropping the SQLite error message when rethrowing Björn Höfling
@ 2018-11-16 20:51 ` Ludovic Courtès
  2018-11-16 21:14   ` Björn Höfling
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2018-11-16 20:51 UTC (permalink / raw)
  To: Björn Höfling; +Cc: 33407-done

Hello,

Björn Höfling <bjoern.hoefling@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’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#33407: Cuirass is dropping the SQLite error message when rethrowing
  2018-11-16 20:51 ` Ludovic Courtès
@ 2018-11-16 21:14   ` Björn Höfling
  0 siblings, 0 replies; 3+ messages in thread
From: Björn Höfling @ 2018-11-16 21:14 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 33407-done

[-- Attachment #1: Type: text/plain, Size: 1250 bytes --]

On Fri, 16 Nov 2018 21:51:49 +0100
ludo@gnu.org (Ludovic Courtès) wrote:

> Hello,
> 
> Björn Höfling <bjoern.hoefling@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…

That's quick. Thank you,

Björn

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-16 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-16 17:43 bug#33407: Cuirass is dropping the SQLite error message when rethrowing Björn Höfling
2018-11-16 20:51 ` Ludovic Courtès
2018-11-16 21:14   ` Björn Höfling

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).