booleanCatch

inline fun <T : Throwable> booleanCatch(errorCallback: (T) -> Boolean = { true }, run: () -> Any?): Boolean

Run a try catch and if there is an exception return false

Return

True if there was no exception, false if there was

Parameters

T

The Throwable type

errorCallback

What to run if there was an error, defaults to false

run

The block to catch on