Subject: [bug#70494] [PATCH 16/23] store: database: Log when aborting transactions.

From: Ludovic Courtès <[email-masked]>
Date: Thu, 16 May 2024 18:20:40 +0200

Christopher Baines <[email-masked]> skribis:

> Otherwise this has the effect of masking the backtrace/exception.
>
> * guix/store/database.scm (call-with-transaction): Log when aborting.
>
> Change-Id: Iee31905c4688dc62ef37a85b0208fd324ee67d70

> +      (with-throw-handler #t
> +        (lambda ()
> +          (call-with-values proc
> +            (lambda vals
> +              (sqlite-exec db "commit;")
> +              (apply values vals))))
> +        (lambda (key args)
> +          (simple-format
> +           (current-error-port)
> +           "transaction aborted: ~A: ~A\n" key args)
> +          (backtrace))))

I would just let the sqlite exception through, which should have a
similar effect (Guile will exit and display a backtrace).