瀏覽代碼

HttpNodeJs when no connection (#12137)

* Update HttpNodeJs.hx

Request can error when there is no connection

* passes error
M 5 月之前
父節點
當前提交
3644e6ac83
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      std/haxe/http/HttpNodeJs.hx

+ 3 - 1
std/haxe/http/HttpNodeJs.hx

@@ -123,7 +123,9 @@ class HttpNodeJs extends haxe.http.HttpBase {
 				req.setHeader("Content-Length", '${postBytes.length}');
 				req.write(Buffer.from(postBytes.getData()));
 			}
-
+		req.on('error', function(e) {
+            		onError(e);
+         	});
 		req.end();
 	}
 }