Skip to content

Commit

Permalink
CORDA-2317: Improved error message if counterparty forgets to call Re…
Browse files Browse the repository at this point in the history
…ceiveFinalityFlow (corda#4407)
  • Loading branch information
shamsasari authored Dec 12, 2018
1 parent ed3bc27 commit 5bc2575
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions core/src/main/kotlin/net/corda/core/flows/FinalityFlow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
}
}

Expand Down

0 comments on commit 5bc2575

Please sign in to comment.