diff options
author | Christopher Baines <mail@cbaines.net> | 2021-02-18 19:26:30 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2021-02-18 19:26:30 +0000 |
commit | 85b1276a33d5cfaf668801d4603e745e0b6c7173 (patch) | |
tree | cef70e3599f1b3292bfe783b83ec8dfd2de64e2f | |
parent | 6d9f61dd28402f2a3519ee9a0d75624080bd56b7 (diff) | |
download | build-coordinator-85b1276a33d5cfaf668801d4603e745e0b6c7173.tar build-coordinator-85b1276a33d5cfaf668801d4603e745e0b6c7173.tar.gz |
Add exception handling for the submit outputs hook
-rw-r--r-- | guix-build-coordinator/coordinator.scm | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm index 2768a1a..f9f9bf8 100644 --- a/guix-build-coordinator/coordinator.scm +++ b/guix-build-coordinator/coordinator.scm @@ -700,16 +700,28 @@ (map (lambda (build) (define submit-outputs? - (let ((hook-result (build-submit-outputs-hook build-coordinator - (assq-ref build 'uuid)))) - (if (boolean? hook-result) - hook-result - (begin - (log-msg (build-coordinator-logger build-coordinator) - 'CRITICAL - "build-submit-outputs hook returned non boolean: " - hook-result) - #t)))) + (with-exception-handler + (lambda (exn) + (log-msg (build-coordinator-logger build-coordinator) + 'CRITICAL + "build-submit-outputs hook raised exception: " + exn)) + (lambda () + (with-throw-handler #t + (lambda () + (let ((hook-result (build-submit-outputs-hook build-coordinator + (assq-ref build 'uuid)))) + (if (boolean? hook-result) + hook-result + (begin + (log-msg (build-coordinator-logger build-coordinator) + 'CRITICAL + "build-submit-outputs hook returned non boolean: " + hook-result) + #t)))) + (lambda (key . args) + (backtrace)))) + #:unwind? #t)) `(,@build ;; TODO This needs reconsidering when things having been built in |