in
let tokens = (Str.split (Str.regexp "/") str) in
(* ty = "cic:" *)
- let (ty, sp) = (List.hd tokens, List.tl tokens) in
+ let (ty, sp) =
+ (try (List.hd tokens, List.tl tokens)
+ with Failure "hd" | Failure "tl" ->
+ raise (IllFormedUri str))
+ in
aux ty sp
;;