public static WrappedRunnable wrap(Runnable runnable) {
    if (runnable instanceof WrappedRunnable) {
      return (WrappedRunnable) runnable;
    }
    return new WrappedRunnable() {
      @Override
      public void runMayThrow() {
        runnable.run();
      }
    };
  }
A wrapper for {@link Runnable} logging errors when uncaught exception is thrown.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/concurrent/WrappedRunnable.java