Replace 'assert false' with 'failwith'
This commit is contained in:
parent
e14386880d
commit
46bb83da92
2 changed files with 3 additions and 3 deletions
|
@ -62,7 +62,7 @@ let compile_zones zones =
|
|||
let compiled = compile_zone acc zone in
|
||||
(name, compiled) :: acc)
|
||||
sorted []
|
||||
| _ -> assert false
|
||||
| _ -> failwith "cyclic dependency in zones definitions"
|
||||
|
||||
let find_ipv4 zones negate addrs_list =
|
||||
let open Prefix in
|
||||
|
|
|
@ -20,7 +20,7 @@ module Zone = struct
|
|||
&> (str |> name)
|
||||
| `Assoc [ ("not", json) ] -> Not (of_json json)
|
||||
| `List list -> List (List.map of_json list)
|
||||
| _ -> assert false
|
||||
| _ -> failwith "invalid zone definition"
|
||||
end
|
||||
|
||||
module Addrs = struct
|
||||
|
@ -73,7 +73,7 @@ module PayloadRule = struct
|
|||
| "tcp" -> Tcp (Tcp.of_json json)
|
||||
| "udp" -> Udp (Udp.of_json json)
|
||||
| "icmp" -> Icmp
|
||||
| _ -> assert false
|
||||
| proto -> failwith ("invalid protocol " ^ proto)
|
||||
end
|
||||
|
||||
let to_addr_list json = json |> to_list_loose |> List.map Addrs.of_json
|
||||
|
|
Loading…
Reference in a new issue