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
|
let compiled = compile_zone acc zone in
|
||||||
(name, compiled) :: acc)
|
(name, compiled) :: acc)
|
||||||
sorted []
|
sorted []
|
||||||
| _ -> assert false
|
| _ -> failwith "cyclic dependency in zones definitions"
|
||||||
|
|
||||||
let find_ipv4 zones negate addrs_list =
|
let find_ipv4 zones negate addrs_list =
|
||||||
let open Prefix in
|
let open Prefix in
|
||||||
|
|
|
@ -20,7 +20,7 @@ module Zone = struct
|
||||||
&> (str |> name)
|
&> (str |> name)
|
||||||
| `Assoc [ ("not", json) ] -> Not (of_json json)
|
| `Assoc [ ("not", json) ] -> Not (of_json json)
|
||||||
| `List list -> List (List.map of_json list)
|
| `List list -> List (List.map of_json list)
|
||||||
| _ -> assert false
|
| _ -> failwith "invalid zone definition"
|
||||||
end
|
end
|
||||||
|
|
||||||
module Addrs = struct
|
module Addrs = struct
|
||||||
|
@ -73,7 +73,7 @@ module PayloadRule = struct
|
||||||
| "tcp" -> Tcp (Tcp.of_json json)
|
| "tcp" -> Tcp (Tcp.of_json json)
|
||||||
| "udp" -> Udp (Udp.of_json json)
|
| "udp" -> Udp (Udp.of_json json)
|
||||||
| "icmp" -> Icmp
|
| "icmp" -> Icmp
|
||||||
| _ -> assert false
|
| proto -> failwith ("invalid protocol " ^ proto)
|
||||||
end
|
end
|
||||||
|
|
||||||
let to_addr_list json = json |> to_list_loose |> List.map Addrs.of_json
|
let to_addr_list json = json |> to_list_loose |> List.map Addrs.of_json
|
||||||
|
|
Loading…
Reference in a new issue