Browse Source

[eval] catch Unix.connect exceptions

Simon Krajewski 6 năm trước cách đây
mục cha
commit
51af109183
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/macro/eval/evalStdLib.ml

+ 1 - 1
src/macro/eval/evalStdLib.ml

@@ -1867,7 +1867,7 @@ module StdSocket = struct
 		let this = this vthis in
 		let host = decode_i32 host in
 		let port = decode_int port in
-		Unix.connect this (ADDR_INET (StdHost.int32_addr host,port));
+		(try Unix.connect this (ADDR_INET (StdHost.int32_addr host,port)) with Unix_error(err,cmd,args) -> exc_string (Printf.sprintf "%s(%s, %s)" (Unix.error_message err) cmd args));
 		vnull
 	)