Jelajahi Sumber

HttpNodeJs when no connection (#12137)

* Update HttpNodeJs.hx

Request can error when there is no connection

* passes error
M 5 bulan lalu
induk
melakukan
3644e6ac83
1 mengubah file dengan 3 tambahan dan 1 penghapusan
  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();
 	}
 }