Closed arniu closed 2 years ago
Do you have an example where the handler throws an exception?
In any case the exception will be handled and the test context will fail, but things like assertions must be wrapped using verify(() -> { ... }
.
In the handler, there is not only assertion. Users may write any code here. And as a result, any exception may happen, not just assertion failures.
For example:
// `tc` is a `VertxTestContext`
tc. succeeding(it -> {
// some other code <1>
tc.verify(() -> {
// assertions <2>
});
});
When any exception occurs at <1>, it takes too long to get result.
You are right, but do you have any example of Vert.x-related code that throws an exception in <1>
? Vert.x code typically forwards errors not as exceptions, but as asynchronous results with an exception.
Vert.x is fine. It's nothing about vertx, it's just about ergonomics.
This PR can be closed. The requested feature has been implemented in #81 that has been released in Vert.x 4.0.0.
@jponge ?