Browse Source

HttpNodeJs when no connection (#12137)

* Update HttpNodeJs.hx

Request can error when there is no connection

* passes error
M 5 tháng trước cách đây
mục cha
commit
3644e6ac83
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  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();
 	}
 }