Replace 'assert false' with 'failwith'

This commit is contained in:
jeltz 2022-09-06 17:35:14 +02:00
parent e14386880d
commit 46bb83da92
Signed by: jeltz
GPG key ID: 800882B66C0C3326
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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