aboutsummaryrefslogtreecommitdiff
path: root/guix-qa-frontpage/guix-data-service.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-11-17 20:49:24 +0000
committerChristopher Baines <mail@cbaines.net>2022-11-17 20:51:21 +0000
commit84d44009ed51e45dbae45a4c94d4bd4c51b1d090 (patch)
tree7acd79e83dbe6b729413b661f562ca4078e890ee /guix-qa-frontpage/guix-data-service.scm
parent1a71ec0120f120d5d1d91ff25c5ba9334d71883c (diff)
downloadqa-frontpage-84d44009ed51e45dbae45a4c94d4bd4c51b1d090.tar
qa-frontpage-84d44009ed51e45dbae45a4c94d4bd4c51b1d090.tar.gz
Raise errors from patch-series-comparison
When the response indicates a problem.
Diffstat (limited to 'guix-qa-frontpage/guix-data-service.scm')
-rw-r--r--guix-qa-frontpage/guix-data-service.scm17
1 files changed, 14 insertions, 3 deletions
diff --git a/guix-qa-frontpage/guix-data-service.scm b/guix-qa-frontpage/guix-data-service.scm
index efcafb7..796b12f 100644
--- a/guix-qa-frontpage/guix-data-service.scm
+++ b/guix-qa-frontpage/guix-data-service.scm
@@ -10,7 +10,11 @@
#:use-module (json)
#:use-module (guix-build-coordinator utils)
#:use-module (guix-qa-frontpage patchwork)
- #:export (patch-series-derivation-changes-url
+ #:export (&guix-data-service-error
+ guix-data-service-error?
+ guix-data-service-error-response-body
+
+ patch-series-derivation-changes-url
patch-series-derivation-changes
patch-series-compare-url
@@ -24,6 +28,11 @@
get-latest-processed-branch-revision))
+(define-exception-type &guix-data-service-error &error
+ make-guix-data-service-error
+ guix-data-service-error?
+ (response-body guix-data-service-error-response-body))
+
(define* (patch-series-derivation-changes-url checks #:key systems)
(define comparison-check
(match (sort (filter (lambda (check)
@@ -113,10 +122,12 @@
(let ((json-body
(json-string->scm (utf8->string body))))
(if (assoc-ref json-body "error")
- #f
+ (raise-exception
+ (make-guix-data-service-error json-body))
json-body)))))
#:times 6
- #:delay 5))
+ #:delay 5
+ #:ignore guix-data-service-error?))
(define (list-branches-url repository-id)
(simple-format #f "https://data.qa.guix.gnu.org/repository/~A.json"