Merge pull request #3727 from corda/improved-error-message-for-missing-suspendable-cases

Added more descriptive error message for the cases when a transaction…
This commit is contained in:
Ivan Schasny 2018-08-20 13:18:26 +01:00 committed by GitHub
commit 9bb9c6ae30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)
}