planetiler/planetiler-core/src/main/java/com/onthegomap/planetiler/worker/RunnableThatThrows.java

19 wiersze
331 B
Java

package com.onthegomap.planetiler.worker;
/**
* A function that can throw checked exceptions.
*/
@FunctionalInterface
public interface RunnableThatThrows {
void run() throws Exception;
default void runAndWrapException() {
try {
run();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}