package exh.util inline fun ignore(expr: () -> T): T? { return try { expr() } catch (t: Throwable) { null } } fun T.withRootCause(cause: Throwable): T { val curCause = this.cause if (curCause == null) { this.initCause(cause) } else { curCause.withRootCause(cause) } return this }