package com.fr.base.function; import com.fr.log.FineLoggerFactory; /** * 可抛出异常的 Runnable * * created by Harrison on 2022/05/24 **/ public interface ThrowableRunnable { void run() throws T; static Runnable toRunnable(ThrowableRunnable runnable) { return () -> { try { runnable.run(); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } }; } }