CORDA-2317: Improved error message if counterparty forgets to call ReceiveFinalityFlow (#4407)

This commit is contained in:
Shams Asari 2018-12-12 17:17:29 +00:00 committed by GitHub
parent ed3bc27501
commit 5bc2575345
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,8 +128,17 @@ class FinalityFlow private constructor(val transaction: SignedTransaction,
}
} else {
for (session in sessions) {
subFlow(SendTransactionFlow(session, notarised))
logger.info("Party ${session.counterparty} received the transaction.")
try {
subFlow(SendTransactionFlow(session, notarised))
logger.info("Party ${session.counterparty} received the transaction.")
} catch (e: UnexpectedFlowEndException) {
throw UnexpectedFlowEndException(
"${session.counterparty} has finished prematurely and we're trying to send them the finalised transaction. " +
"Did they forget to call ReceiveFinalityFlow? (${e.message})",
e.cause,
e.originalErrorId
)
}
}
}