guix-commits
[Top][All Lists]
Advanced

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

02/02: Raise a clearer exception when a linter crashes


From: Christopher Baines
Subject: 02/02: Raise a clearer exception when a linter crashes
Date: Mon, 23 May 2022 14:21:58 -0400 (EDT)

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

commit e5cb793d4e1853dd3ae675e3f3bbcf3e4cb58304
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Mon May 23 19:19:57 2022 +0100

    Raise a clearer exception when a linter crashes
---
 guix-data-service/jobs/load-new-guix-revision.scm | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/guix-data-service/jobs/load-new-guix-revision.scm 
b/guix-data-service/jobs/load-new-guix-revision.scm
index bbdc7fc..b7e08b3 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -494,11 +494,19 @@ WHERE job_id = $1")
             (let* ((package (hashv-ref %package-table package-id))
                    (warnings
                     (map process-lint-warning
-                         (if (and lint-checker-requires-store?-defined?
-                                  (lint-checker-requires-store? checker))
-
-                             (check package #:store store)
-                             (check package)))))
+                         (with-exception-handler
+                             (lambda (exn)
+                               (simple-format (current-error-port)
+                                              "exception checking ~A with ~A 
checker: ~A\n"
+                                              package ',checker-name exn)
+                               (raise-exception exn))
+                           (lambda ()
+                             (if (and lint-checker-requires-store?-defined?
+                                      (lint-checker-requires-store? checker))
+
+                                 (check package #:store store)
+                                 (check package)))
+                           #:unwind? #t))))
               (if (null? warnings)
                   #f
                   (cons package-id warnings))))



reply via email to

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