From 46bb83da9230872294a223f87f07b985868b44eb Mon Sep 17 00:00:00 2001 From: Jeltz Date: Tue, 6 Sep 2022 17:35:14 +0200 Subject: [PATCH] Replace 'assert false' with 'failwith' --- compile.ml | 2 +- config.ml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compile.ml b/compile.ml index edda011..7450687 100644 --- a/compile.ml +++ b/compile.ml @@ -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 diff --git a/config.ml b/config.ml index 614f939..9eaa695 100644 --- a/config.ml +++ b/config.ml @@ -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