execute

suspend fun <T> execute(block: suspend () -> T): T

Executes block, potentially injecting a delay and/or failure according to configuration.

Return

The result of block if no failure is injected.

Parameters

block

The suspendable operation to execute (may be wrapped with injected faults).

Type Parameters

T

The return type of block.

Throws

The configured exception if a failure is injected, or any exception from block.