withRestActionReasonContext

suspend fun <R> withRestActionReasonContext(reason: String, block: suspend CoroutineScope.() -> R): R(source)

Applies the provided reason as the default reason for all AuditableRestAction in the block.

This is the equivalent of ThreadLocalReason for coroutines.

Note: If you want to modify the reason inside the block, use this function again, do not use ThreadLocalReason.setCurrent.

See also