diff options
author | Christopher Baines <mail@cbaines.net> | 2020-02-15 21:58:07 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-02-15 21:58:07 +0000 |
commit | cc370fae563b4836bfd8422689b85252cb3f09b5 (patch) | |
tree | 2cebfe302f6f371a884cac7104b562a170c1ab7a | |
parent | 119fd801e13c0e866ecbe8771d8ba664cb1ed72d (diff) | |
download | data-service-cc370fae563b4836bfd8422689b85252cb3f09b5.tar data-service-cc370fae563b4836bfd8422689b85252cb3f09b5.tar.gz |
Better handle errors when fetching builds by output
-rw-r--r-- | guix-data-service/builds.scm | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/guix-data-service/builds.scm b/guix-data-service/builds.scm index d65b1e8..f64ff51 100644 --- a/guix-data-service/builds.scm +++ b/guix-data-service/builds.scm @@ -232,26 +232,41 @@ initial connection on which HTTP requests are sent." derivation-output-paths-and-details-sets-ids) (lambda (data output) (if data - (let* ((derivation - (assoc-ref data "derivation")) - (build-id - (ensure-build-exists - conn - build-server-id - derivation - #:derivation-output-details-set-id - (cdr - (vhash-assoc output - derivation-output-paths-and-details-sets-ids))))) - (insert-build-statuses-from-data - conn - build-server-id - build-id - (assoc-ref data "build")) - (if (verbose-output?) - (simple-format #t "found build for: ~A (~A)\n" - output derivation) - (display "-"))) + (catch #t + (lambda () + (let* ((derivation + (assoc-ref data "derivation")) + (build-id + (ensure-build-exists + conn + build-server-id + derivation + #:derivation-output-details-set-id + (cdr + (vhash-assoc output + derivation-output-paths-and-details-sets-ids))))) + (insert-build-statuses-from-data + conn + build-server-id + build-id + (assoc-ref data "build")) + (if (verbose-output?) + (simple-format #t "found build for: ~A (~A)\n" + output derivation) + (display "-")))) + (lambda (key . args) + (simple-format + (current-error-port) + "\nerror processing data for output: ~A\n" + output) + (simple-format (current-error-port) + "~A\n" + data) + (simple-format + (current-error-port) + "~A: ~A\n" + key + args))) (if (verbose-output?) (simple-format #t "no build found: ~A\n" output) (display ".")))))) |