aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-06-28 13:13:32 +0100
committerChristopher Baines <mail@cbaines.net>2020-07-01 17:43:38 +0100
commitf3eadb6984bc3fb9a4b69633c9ad68e143e95173 (patch)
tree228943cf0147aeebfc1ba63bd7fdf3a82e20e161
parentdbadb56b19b76d62d0dddfdea1f1676b0366b729 (diff)
downloadbuild-coordinator-f3eadb6984bc3fb9a4b69633c9ad68e143e95173.tar
build-coordinator-f3eadb6984bc3fb9a4b69633c9ad68e143e95173.tar.gz
Improve error reporting within the sqlite threads
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm17
1 files changed, 11 insertions, 6 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index 5ed70ac..e8d1ee2 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -150,12 +150,17 @@
(sqlite-exec db "ROLLBACK TRANSACTION;")
(raise-exception exn))
(lambda ()
- (call-with-values
- (lambda ()
- (proc db))
- (lambda vals
- (sqlite-exec db "COMMIT TRANSACTION;")
- (apply values vals))))
+ (with-exception-handler
+ (lambda (exn)
+ (backtrace)
+ (raise-exception exn))
+ (lambda ()
+ (call-with-values
+ (lambda ()
+ (proc db))
+ (lambda vals
+ (sqlite-exec db "COMMIT TRANSACTION;")
+ (apply values vals))))))
#:unwind? #t))))
(define-method (datastore-find-agent