Class FailuresKt
-
- All Implemented Interfaces:
public final class FailuresKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> TorNullLogged(Logger log, String message, Function0<T> block)block's result, or nullwith message and the failure logged at WARN to log when it throws an Exception — for a value whose absence the caller can answer without, but whose loss must not go unseen.-
-
Method Detail
-
orNullLogged
final static <T extends Any> T orNullLogged(Logger log, String message, Function0<T> block)
block's result, or
nullwith message and the failure logged at WARN to log when it throws an Exception — for a value whose absence the caller can answer without, but whose loss must not go unseen.Only an Exception is turned into
null: an Error and a CancellationException propagate, and an InterruptedException re-asserts the thread's interrupt status, which throwing it had cleared.
-
-
-
-