guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Better guard against exceptions in the build even


From: Christopher Baines
Subject: branch master updated: Better guard against exceptions in the build event handlers
Date: Sat, 19 Nov 2022 04:46:32 -0500

This is an automated email from the git hooks/post-receive script.

cbaines pushed a commit to branch master
in repository data-service.

The following commit(s) were added to refs/heads/master by this push:
     new 205f020  Better guard against exceptions in the build event handlers
205f020 is described below

commit 205f0209502375bff27d886d152281b50fef1f64
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sat Nov 19 09:46:16 2022 +0000

    Better guard against exceptions in the build event handlers
---
 guix-data-service/web/build-server/controller.scm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]