aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-11-19 09:46:16 +0000
committerChristopher Baines <mail@cbaines.net>2022-11-19 09:46:16 +0000
commit205f0209502375bff27d886d152281b50fef1f64 (patch)
treec808d08e0774fbb295b287783924440544fd2f14 /guix-data-service
parentca1e4819b6d5a7e8588f98979831fb755047ec53 (diff)
downloaddata-service-205f0209502375bff27d886d152281b50fef1f64.tar
data-service-205f0209502375bff27d886d152281b50fef1f64.tar.gz
Better guard against exceptions in the build event handlers
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/web/build-server/controller.scm15
1 files changed, 14 insertions, 1 deletions
diff --git a/guix-data-service/web/build-server/controller.scm b/guix-data-service/web/build-server/controller.scm
index a35a62f..bbc4a93 100644
--- a/guix-data-service/web/build-server/controller.scm
+++ b/guix-data-service/web/build-server/controller.scm
@@ -144,7 +144,20 @@
(with-postgresql-connection
"build-event-handler-conn"
(lambda (conn)
- (handler conn ids)))))))))
+ (with-exception-handler
+ (lambda (exn)
+ (simple-format
+ (current-error-port)
+ "exception in build event handler: ~A\n"
+ exn))
+ (lambda ()
+ (with-throw-handler #t
+ (lambda ()
+ (handler conn ids))
+ (lambda _
+ (display (backtrace) (current-error-port))
+ (display "\n" (current-error-port)))))
+ #:unwind? #t)))))))))
(define (handle-derivation-events conn items)
(if (null? items)