Merge pull request #921 from corda/ENT-1983

ENT-1983: throw more specific exception when starting a flow as a result
This commit is contained in:
Matthew Nesbit 2018-06-06 12:09:10 +01:00 committed by GitHub
commit 2aac9e8687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,7 +146,7 @@ class MultiThreadedStateMachineManager(
serviceHub.networkMapCache.nodeReady.then {
resumeRestoredFlows(fibers)
flowMessaging.start { receivedMessage, deduplicationHandler ->
lifeCycle.requireState(State.STARTED) {
lifeCycle.requireState(State.STARTED, StateMachineStoppedException("Flow cannot be started. State machine is stopped.")) {
deliverExternalEvent(deduplicationHandler.externalCause)
}
}