public RuntimeException exception() {
        if (!failed())
            throw new IllegalStateException("Attempt to retrieve exception from future which hasn't failed");
        return (RuntimeException) result.get();
    }
Get the exception from a failed result (only available if the request failed)
@return the exception set in {@link #raise(RuntimeException)}
@throws IllegalStateException if the future is not complete or completed successfully
clients/src/main/java/org/apache/kafka/clients/consumer/internals/RequestFuture.java