mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-10-22 07:40:32 +00:00
small logic fix in transactions dsl
This commit is contained in:
@@ -63,7 +63,7 @@ suspend fun <T> TransactionsDSL.rollbackableOperation(
|
|||||||
* @param onRollbackStepError Will be called if rollback action throwing some error
|
* @param onRollbackStepError Will be called if rollback action throwing some error
|
||||||
*/
|
*/
|
||||||
suspend fun <T> doSuspendTransaction(
|
suspend fun <T> doSuspendTransaction(
|
||||||
onRollbackStepError: suspend (TransactionDSLRollbackLambda, Throwable) -> Unit = { _, _ -> },
|
onRollbackStepError: suspend (Throwable) -> Unit = { },
|
||||||
block: suspend TransactionsDSL.() -> T
|
block: suspend TransactionsDSL.() -> T
|
||||||
): Result<T> {
|
): Result<T> {
|
||||||
val transactionsDSL = TransactionsDSL()
|
val transactionsDSL = TransactionsDSL()
|
||||||
@@ -75,7 +75,7 @@ suspend fun <T> doSuspendTransaction(
|
|||||||
runCatching {
|
runCatching {
|
||||||
it.invoke(e)
|
it.invoke(e)
|
||||||
}.onFailure { ee ->
|
}.onFailure { ee ->
|
||||||
onRollbackStepError(it, ee)
|
onRollbackStepError(ee)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user