OnFailure

fun interface OnFailure : ItBlock<Throwable> (source)

An alias of ItBlock indicating a callback for something occurring exceptionally.

NOTE: The exception should not be re-thrown within the OnFailure lambda. If OnFailure is being utilized with TorRuntime APIs, it will be treated as an UncaughtException and dispatched to RuntimeEvent.ERROR observers.

See also

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract operator fun invoke(it: Throwable)
Link copied to clipboard
@JvmStatic
@JvmName(name = "immediateErrorJob")
fun OnFailure.toImmediateErrorJob(name: String, cause: Throwable, handler: UncaughtException.Handler): EnqueuedJob

Creates a EnqueuedJob which immediately invokes OnFailure with the provided cause.