private Runnable wrap()

in geronimo-opentracing-common/src/main/java/org/apache/geronimo/microprofile/opentracing/common/microprofile/thread/OpenTracingExecutorService.java [110:124]


    private Runnable wrap(final Runnable task) {
        final ScopePropagatingCallable<Void> decorator = new ScopePropagatingCallable<>(() -> {
            task.run();
            return null;
        }, tracer);
        return () -> {
            try {
                decorator.call();
            } catch (final RuntimeException | Error e) {
                throw e;
            } catch (final Exception e) { // unlikely since that's a Runnable
                throw new IllegalStateException(e);
            }
        };
    }