Exception wrapping

My requirement to send specific exception inFlux.error(..) from RSocket server to client is always getting wrapped into io.rsocket.exceptions.ApplicationErrorException.
In many scenarios, it will be helpful if the actual error sent from server is received in client.


RSocket protocol only allows passing UTF-8 strings in error payload, also protocol implementations are generally expected to be technology agnostic - e.g. if exception is passed from js environment, It cant be represented in jvm environment.

One possible solution is encoding exception type and state in Exception message on sending side, then decoding It on receiving side & instantiation of proper exception reflectively, e.g. by implementing this in requester interceptor. This assumes both peers are jvm applications.

Thanks. This explanation makes sense.