From 7596254e9f33e678fe557dcd789b80c56223a162 Mon Sep 17 00:00:00 2001 From: Josu Igoa Date: Thu, 19 Sep 2024 10:07:51 +0200 Subject: [PATCH] handle HttpNodeJs request error --- std/haxe/http/HttpNodeJs.hx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/std/haxe/http/HttpNodeJs.hx b/std/haxe/http/HttpNodeJs.hx index d845d315d92..87a59e4fef8 100644 --- a/std/haxe/http/HttpNodeJs.hx +++ b/std/haxe/http/HttpNodeJs.hx @@ -124,6 +124,10 @@ class HttpNodeJs extends haxe.http.HttpBase { req.write(Buffer.from(postBytes.getData())); } + req.on('error', function(e) { + onError("Http Request Error: " + e); + }); + req.end(); } }