History

Better diagnostic messages

malc committed 6 years ago

Commit 9665c231 parent 89f5bd81 file · +3 −2Browse files

Unified · Split

config.ml+3−2
@@ -712,14 +712,15 @@ let keys_of_string s = · 711 unmodified lines
712712
713713 let validatehcs v =
714714 let l = String.length v in
715− if l < 2 then failwith "set is too small, must be greater than one char";
715+ if l < 2
716+ then error "set must contain more than one char, but has %d" l;
716717 let module S = Set.Make (struct type t = char let compare = compare end) in
717718 let rec check s i =
718719 if i < l
719720 then
720721 let e = String.get v i in
721722 if S.mem e s
722− then failwith "has duplicates"
723+ then error "set has duplicates (at least '%c')" e
723724 else check (S.add e s) (i+1)
724725 in
725726 check (S.singleton (String.get v 0)) 1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t