Move FlowSessionException into core so that it can be serialised. (#654)

This commit is contained in:
Chris Rankin 2017-05-09 18:09:34 +01:00 committed by GitHub
parent 5188e672eb
commit bb0ac3253d
3 changed files with 10 additions and 9 deletions

View File

@ -17,3 +17,11 @@ open class FlowException(override val message: String?, override val cause: Thro
constructor(cause: Throwable?) : this(cause?.toString(), cause)
constructor() : this(null, null)
}
/**
* 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)

View File

@ -3,6 +3,7 @@ package net.corda.node.services.statemachine
import net.corda.core.crypto.Party
import net.corda.core.flows.FlowException
import net.corda.core.flows.FlowLogic
import net.corda.core.flows.FlowSessionException
import net.corda.core.serialization.CordaSerializable
import net.corda.core.utilities.UntrustworthyData
@ -48,11 +49,3 @@ fun <T> ReceivedSessionMessage<SessionData>.checkPayloadIs(type: Class<T>): Untr
"${message.payload.javaClass.name} (${message.payload})")
}
}
/**
* 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)

View File

@ -12,6 +12,7 @@ import net.corda.core.crypto.SecureHash
import net.corda.core.crypto.generateKeyPair
import net.corda.core.flows.FlowException
import net.corda.core.flows.FlowLogic
import net.corda.core.flows.FlowSessionException
import net.corda.core.flows.InitiatingFlow
import net.corda.core.messaging.MessageRecipients
import net.corda.core.node.services.PartyInfo
@ -45,7 +46,6 @@ import net.corda.testing.sequence
import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.Assertions.assertThatThrownBy
import org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType
import org.bouncycastle.asn1.x500.X500Name
import org.junit.After
import org.junit.Before
import org.junit.Test