static <T> IAsyncResultHandler<T> explodeOnFailure(TestContext context, Async async, Handler<T> successHandler) {
        return new IAsyncResultHandler<T>() {

            @Override
            public void handle(IAsyncResult<T> result) {
                if (result.isSuccess()) {
                    successHandler.handle(result.getResult());
                } else {
                    System.err.println("Operation failed"); //$NON-NLS-1$
                    context.fail(result.getError());
                }
            }
        };
    }
Handler that fails tests if result is unsuccessful, with the exception included in the error.

@param context the test context
@param async the async object
@param successHandler the success handler, called only if the result was successful
@return the result handler
gateway/platforms/vertx3/vertx3/src/test/java/io/apiman/gateway/platforms/vertx3/components/jdbc/SpecHelpers.java