Skip to content

Commit 9cac3e9

Browse files
committed
Improve verification error messages
This should help with some verification confusion.
1 parent 04fdb5e commit 9cac3e9

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/clojars/verification.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
(err request "The domain name is not a valid domain name.")
8080

8181
(not (group+domain-correspond? group domain))
82-
(err request "Group and domain do not correspond with each other.")
82+
(err request "Group and domain do not correspond with each other. Example: if your domain is 'example.com', your group must be (or start with) 'com.example'.")
8383

8484
;; This should never be hit currently, since we have no reverse-domain
8585
;; groups in the reserved list. It is here in case we add one in the
@@ -175,7 +175,8 @@
175175
groups-to-verify (set/difference candidate-groups group-verifications)]
176176
(cond
177177
(not provider)
178-
(err request "The format of the URL is invalid.")
178+
(err request (format "The format of the URL is invalid. It must be of the form 'https://<vcs-host>.com/<org>/clojars-%s', where '<vcs-host>' is either 'github' or 'gitlab'."
179+
username))
179180

180181
(= candidate-groups group-verification-names)
181182
(let [{:keys [created verified_by]} (first group-verifications)]

test/clojars/unit/verification_test.clj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"..com"))
4747

4848
(deftest verify-group-by-TXT-with-no-correspondence
49-
(is (= "Group and domain do not correspond with each other."
49+
(is (= "Group and domain do not correspond with each other. Example: if your domain is 'example.com', your group must be (or start with) 'com.example'."
5050
(:error (nut/verify-group-by-TXT help/*db* {:group "com.foo" :domain "bar.com"})))))
5151

5252
(deftest verify-group-by-TXT-with-invalid-TXT
@@ -168,8 +168,9 @@
168168

169169
(deftest verify-vcs-groups-with-invalid-url
170170
(is (match?
171-
{:error "The format of the URL is invalid."}
172-
(nut/verify-vcs-groups help/*db* {:url "huh?"}))))
171+
{:error "The format of the URL is invalid. It must be of the form 'https://<vcs-host>.com/<org>/clojars-dantheman', where '<vcs-host>' is either 'github' or 'gitlab'."}
172+
(nut/verify-vcs-groups help/*db* {:url "huh?"
173+
:username "dantheman"}))))
173174

174175
(deftest verify-vcs-groups-with-url-not-matching-user
175176
(is (match?

0 commit comments

Comments
 (0)