diff options
author | Christopher Baines <mail@cbaines.net> | 2025-02-03 22:38:27 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2025-02-03 22:59:34 +0000 |
commit | 3646de60975b60baeb006f58716d5c198ec32602 (patch) | |
tree | ddeeb14f8c74c3afcbc1076840d01464b45f09b9 /guix-data-service | |
parent | 931b7bc5934f3bc05c6eb5841ad9239c36d6181e (diff) | |
download | data-service-3646de60975b60baeb006f58716d5c198ec32602.tar data-service-3646de60975b60baeb006f58716d5c198ec32602.tar.gz |
Update exception handling in load-new-guix-revision
Diffstat (limited to 'guix-data-service')
-rw-r--r-- | guix-data-service/jobs/load-new-guix-revision.scm | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm index 1e88436..6a4c213 100644 --- a/guix-data-service/jobs/load-new-guix-revision.scm +++ b/guix-data-service/jobs/load-new-guix-revision.scm @@ -1332,13 +1332,14 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1" (lambda (exn) (put-message channel `(exception . ,exn))) (lambda () - (with-throw-handler #t + (with-exception-handler + (lambda (exn) + (print-backtrace-and-exception/knots exn) + (raise-exception exn)) (lambda () (call-with-values thunk (lambda values - (put-message channel `(values ,@values))))) - (lambda _ - (backtrace)))) + (put-message channel `(values ,@values))))))) #:unwind? #t)))) (match (get-message channel) @@ -1528,18 +1529,20 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1" (cons system #f)) (raise-exception exn))) (lambda () - (with-throw-handler #t + (with-exception-handler + (lambda (exn) + (simple-format + (current-error-port) + "failed to compute channel instance derivation for ~A\n" + system) + (print-backtrace-and-exception/knots exn) + (raise-exception exn)) (lambda () (cons system (inferior-eval-with-store/non-blocking inferior inferior-store - (inferior-code channel-instance system)))) - (lambda _ - (simple-format - (current-error-port) - "failed to compute channel instance derivation for ~A\n" - system)))) + (inferior-code channel-instance system)))))) #:unwind? #t))))) systems))) @@ -1697,11 +1700,11 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1" ;; Normalise the locale for the inferior process (with-exception-handler - (lambda (key . args) + (lambda (exn) (simple-format (current-error-port) - "warning: failed to set locale to en_US.UTF-8: ~A ~A\n" - key args)) + "warning: failed to set locale to en_US.UTF-8: ~A\n" + exn)) (lambda () (inferior-eval '(setlocale LC_ALL "en_US.UTF-8") inf))) @@ -2896,7 +2899,13 @@ SKIP LOCKED") (with-exception-handler (const #f) (lambda () - (with-throw-handler #t + (with-exception-handler + (lambda (exn) + (simple-format (current-error-port) + "error: load-new-guix-revision: ~A\n" + exn) + (print-backtrace-and-exception/knots exn) + (raise-exception exn)) (lambda () (load-new-guix-revision conn @@ -2907,12 +2916,7 @@ SKIP LOCKED") extra-inferior-environment-variables #:ignore-systems ignore-systems #:ignore-targets ignore-targets - #:parallelism parallelism)) - (lambda (key . args) - (simple-format (current-error-port) - "error: load-new-guix-revision: ~A ~A\n" - key args) - (backtrace)))) + #:parallelism parallelism)))) #:unwind? #t)) #t) (begin |