public static <T> T throwFatalException(Throwable exception) {
    if (exception instanceof InterruptedException) {
      Thread.currentThread().interrupt();
    }
    if (exception instanceof RuntimeException runtimeException) {
      throw runtimeException;
    } else if (exception instanceof IOException ioe) {
      throw new UncheckedIOException(ioe);
    } else if (exception instanceof Error error) {
      throw error;
    }
    throw new FatalPlanetilerException(exception);
  }
Re-throw a caught exception, handling interrupts and wrapping in a {@link FatalPlanetilerException} if checked.

@param exception The original exception
@param <T>       Return type if caller requires it
planetiler-core/src/main/java/com/onthegomap/planetiler/util/Exceptions.java