Skip to content

Commit 0ad57e0

Browse files
authored
Improve fill-multi/fill-human-multi errors (#655)
1 parent 5bbe8c7 commit 0ad57e0

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/etaoin/api.clj

+9-7
Original file line numberDiff line numberDiff line change
@@ -2761,11 +2761,12 @@
27612761
(fill driver q text))
27622762
(throw+ {:type :etaoin/argument
27632763
:message "Vector q-text must have even length"
2764-
:arg q-text}))
2764+
:q-text q-text
2765+
:length (count q-text)}))
27652766

27662767
:else (throw+ {:type :etaoin/argument
2767-
:message "Wrong argument type"
2768-
:arg q-text})))
2768+
:message "Argument q-text must be a map or vector"
2769+
:q-text q-text})))
27692770

27702771
(defn fill-human-el
27712772
"Have `driver` fill element `el` with `text` as if it were a real human using `opts`.
@@ -2836,12 +2837,13 @@
28362837
(doseq [[q text] (partition 2 q-text)]
28372838
(fill driver q text))
28382839
(throw+ {:type :etaoin/argument
2839-
:message "Vector q-text must have even length"
2840-
:arg q-text}))
2840+
:message "Vector q-text must have even length"
2841+
:q-text q-text
2842+
:length (count q-text)}))
28412843

28422844
:else (throw+ {:type :etaoin/argument
2843-
:message "Wrong argument type"
2844-
:arg q-text}))))
2845+
:message "Argument q-text must be a map or vector"
2846+
:q-text q-text}))))
28452847

28462848
(defn select
28472849
"Convenience function to have `driver` select first option that includes `text` for select element found by query `q`.

0 commit comments

Comments
 (0)