HaxeFoundation / HaxeFoundation/hx3compat
remoting HttpConnection exceptions
- Dominant language
- Haxe
- Stars
- 17
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
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 :
```haxe
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();
}
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in HttpConnection.hx, at the processRequest method shown in the issue, and compare its exception handling with the Haxe 4 behavior described. Done means remoting clients receive readable serialized exception details while preserving compatibility with older Haxe versions.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100