public StreamsException exceptionNow() {
        try {
            addTopologyFuture.getNow(null);
            return null;
        } catch (final ExecutionException e) {
            if (e.getCause() instanceof StreamsException) {
                return (StreamsException) e.getCause();
            } else {
                return new StreamsException(e.getCause());
            }
        } catch (final InterruptedException e) {
            return null;
        }
    }
Boiler plate to get the root cause as a StreamsException if completed exceptionally, otherwise returns {@code null}.
Non-blocking.
streams/src/main/java/org/apache/kafka/streams/processor/internals/namedtopology/AddNamedTopologyResult.java