package org.pacien.tincapp.extensions import java8.util.concurrent.CompletableFuture /** * @author pacien */ object Java { fun CompletableFuture.exceptionallyAccept(fn: (Throwable) -> Unit) = exceptionally { fn(it); null }!! fun applyIgnoringException(f: (A) -> R, x: A, alt: R? = null) = try { f(x) } catch (_: Exception) { alt } }