Open ben1222 opened 5 days ago
Even if the ServiceException
provides a constructor that takes a cause, it still lost the ability to set the cause after the exception is created...
There are some of such use cases that is inconvenient to pass the cause to the constructor...
But I do not have a better solution... perhaps I have to take the inconvenient way to pass the cause to the constructor...
@vietj could you take a look?
Version
4.5.11
Context
We have a subclass of
ServiceException
that usesinitCause
to set the cause of theServiceException
and have a customized codec to encode/decode the cause. However, after recent change inReplyException
(which theServiceException
extends) in vertx 4.5.11: https://github.com/eclipse-vertx/vert.x/issues/5335 , we can no longer useinitCause
for it because the constructorpublic ReplyException(ReplyFailure failureType, int failureCode, String message)
which theServiceException
calls now init the cause withnull
.The
ServiceException
may need to also provide a protected method with cause that allows sub-class to set the cause on it, to matchReplyException
.Do you have a reproducer?
A small unit test that illustrates the problem:
This test case passed on vertx 4.5.10 but failed on vertx 4.5.11: