浏览代码

[eval] catch Unix.connect exceptions

Simon Krajewski 6 年之前
父节点
当前提交
51af109183
共有 1 个文件被更改,包括 1 次插入1 次删除
  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
 	)