We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce59724 commit 9610673Copy full SHA for 9610673
network.ml
@@ -2,6 +2,12 @@ open Prelude
2
3
let () = assert (Sys.word_size = 64)
4
5
+(* reexport exceptions *)
6
+include (Devkit_ragel : sig
7
+ exception Parse_ipv4 of string
8
+ exception Parse_compact_duration of string
9
+end)
10
+
11
type ipv4 = int32
12
type ipv4_cidr = int32 * int32
13
@@ -69,7 +75,7 @@ let cidr_of_string_exn s =
69
75
let ip = ipv4_of_string_exn ip in
70
76
Int32.logand ip mask, mask)
71
77
72
-let cidr_of_string_exn s = try ipv4_of_string_exn s, -1l with Invalid_argument _ -> cidr_of_string_exn s
78
+let cidr_of_string_exn s = try ipv4_of_string_exn s, -1l with Parse_ipv4 _ -> cidr_of_string_exn s
73
79
74
80
let range_of_cidr (ip0,mask) = ip0, make_broadcast ip0 mask
81
0 commit comments