For those who still use haxe remoting, with Haxe 4, exceptions are not very pretty when sended back to the client.
So I have done a small modification in HttpConnection.hx like that :
public static function processRequest( requestData : String, ctx : Context ) : String {
try {
var u = new haxe.Unserializer(requestData);
var path = u.unserialize();
var args = u.unserialize();
var data = ctx.call(path,args);
var s = new haxe.Serializer();
s.serialize(data);
return "hxr" + s.toString();
} catch( e ) {
var s = new haxe.Serializer();
#if (haxe_ver >= 4)
s.serializeException( e.message + "\r\n" + e.details() );
#else
s.serializeException( e );
#end
return "hxr" + s.toString();
}
}
Hej,
For those who still use haxe remoting, with Haxe 4, exceptions are not very pretty when sended back to the client. So I have done a small modification in HttpConnection.hx like that :