Added more descriptive error message for the cases when a transaction context is missing from the flow state machine

This commit is contained in:
Ivan Schasny 2018-07-31 11:22:28 +01:00
parent 494661cc0c
commit d0ecab0781

View File

@ -188,7 +188,9 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
private fun checkDbTransaction(isPresent: Boolean) {
if (isPresent) {
requireNotNull(contextTransactionOrNull)
requireNotNull(contextTransactionOrNull) {
"Transaction context is missing. This might happen if a suspendable method is not annotated with @Suspendable annotation."
}
} else {
require(contextTransactionOrNull == null)
}