guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/11: Guard against derivation IDs that aren't numbers


From: Christopher Baines
Subject: 01/11: Guard against derivation IDs that aren't numbers
Date: Fri, 9 Oct 2020 15:21:18 -0400 (EDT)

cbaines pushed a commit to branch master
in repository data-service.

commit 2c463fcdab78412f65459f37398a185b1ee6a311
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Fri Oct 9 19:27:04 2020 +0100

    Guard against derivation IDs that aren't numbers
    
    I saw an error suggesting that something came back that wasn't a number, and
    this should give a more informative error.
---
 guix-data-service/data-deletion.scm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/guix-data-service/data-deletion.scm 
b/guix-data-service/data-deletion.scm
index 7674535..1d8a22c 100644
--- a/guix-data-service/data-deletion.scm
+++ b/guix-data-service/data-deletion.scm
@@ -493,6 +493,11 @@ WHERE NOT EXISTS (
                  0
                  (map
                   (lambda (derivation-id)
+                    (unless (string->number derivation-id)
+                      (error
+                       (simple-format #f "derivation-id: ~A is not a number"
+                                      derivation-id)))
+
                     (with-thread-postgresql-connection
                      (lambda (conn)
                        (with-postgresql-transaction



reply via email to

[Prev in Thread] Current Thread [Next in Thread]