diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/SessionMessage.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/SessionMessage.kt index d904b1de36..2f6e44eb94 100644 --- a/node/src/main/kotlin/net/corda/node/services/statemachine/SessionMessage.kt +++ b/node/src/main/kotlin/net/corda/node/services/statemachine/SessionMessage.kt @@ -5,6 +5,10 @@ import net.corda.core.flows.FlowException import net.corda.core.serialization.CordaSerializable import net.corda.core.utilities.UntrustworthyData +/** + * These internal messages define the flow session protocol. + */ + @CordaSerializable interface SessionMessage @@ -40,4 +44,10 @@ fun ReceivedSessionMessage.checkPayloadIs(type: Class): Untr } } +/** + * Thrown when a flow session ends unexpectedly due to a type mismatch (the other side sent an object of a type + * that we were not expecting), or the other side had an internal error, or the other side terminated when we + * were waiting for a response. + */ +@CordaSerializable class FlowSessionException(message: String) : RuntimeException(message)