vert-x3 / vertx-service-proxy

EventBus Proxy generation
Apache License 2.0
66 stars 58 forks source link

Custom exception : Manage Failure with codec manager #148

Closed Fyro-Ing closed 9 months ago

Fyro-Ing commented 10 months ago

With CodecManager, we can use custom exceptions ( and object), so HelperUtils#manageFailure could be simplify to Message#reply

public static void manageFailure(Message msg, Throwable cause, boolean includeDebugInfo) {
    msg.reply(cause);
}

https://github.com/vert-x3/vertx-service-proxy/blob/2ab9f4e73585163812718d12c13ef483a5f1c98f/src/main/java/io/vertx/serviceproxy/HelperUtils.java#L120

tsegismont commented 9 months ago

With this code, it is not required to use a custom codec.

Fyro-Ing commented 9 months ago

@tsegismont It's required to have our exception without vertx exception dependency We have only service exception today and we must extends ReplyException to use custom but we need to respect contract ReplyException We can't off stacktrace & to have body we need to use debuginfo, but this not the goal

tsegismont commented 9 months ago

Stack traces are not transferred by the codec because we can't recreate an exception from it on the other side.

See https://github.com/eclipse-vertx/vert.x/issues/486

Fyro-Ing commented 9 months ago

Yes of course.

But i would like to create my exception :

At this time, if i have a custom exception not extends ServiceException, i loose my informations because exceptions that not extends ServiceException are forced to ServiceException

So, at this time, i have custom exception that extends ServiceException, and send my informations with ... debuginfo, but this is not its use