ENT-1983: throw more specific exception when starting a flow as a result

of P2P messaging and SMM is stopped.
This commit is contained in:
bogdan 2018-06-04 19:03:36 +01:00
parent 4f1a22dfac
commit 644f1c6d2f

View File

@ -145,7 +145,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)
}
}