safeCall

inline fun <T> safeCall(message: String? = null, unsafeCall: () -> T?): T?

Executes the provided lambda unsafeCall safely, catching any exceptions and logging them.

Return

The result of the lambda if it executes successfully, otherwise null.

Parameters

unsafeCall

The lambda representing the possibly unsafe call.

message

The optional message to log when the block fails.