diff options
-rw-r--r-- | guix-build-coordinator/coordinator.scm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm index 04cb498..adda7a4 100644 --- a/guix-build-coordinator/coordinator.scm +++ b/guix-build-coordinator/coordinator.scm @@ -59,6 +59,9 @@ agent-error? agent-error-details + client-error? + client-error-details + make-build-coordinator build-coordinator-datastore build-coordinator-hooks @@ -101,6 +104,11 @@ agent-error? (details agent-error-details)) +(define-exception-type &client-error &error + make-client-error + client-error? + (details client-error-details)) + (define-record-type <build-coordinator> (make-build-coordinator-record datastore hooks metrics-registry allocation-strategy logger) @@ -739,13 +747,11 @@ (let ((build-details (datastore-find-build datastore uuid))) (when (assq-ref build-details 'canceled) (raise-exception - (make-exception-with-message - "cannot cancel and already canceled build"))) + (make-client-error 'build-already-canceled))) (when (assq-ref build-details 'processed) (raise-exception - (make-exception-with-message - "cannot cancel and already processed build")))) + (make-client-error 'build-already-processed)))) (when (and ignore-if-build-required-by-another? (datastore-build-required-by-another? datastore |