diff --git a/node/src/main/kotlin/net/corda/node/internal/FlowSafeSubject.kt b/node/src/main/kotlin/net/corda/node/internal/FlowSafeSubject.kt index 4570c8f653..ee406dbaf6 100644 --- a/node/src/main/kotlin/net/corda/node/internal/FlowSafeSubject.kt +++ b/node/src/main/kotlin/net/corda/node/internal/FlowSafeSubject.kt @@ -40,9 +40,9 @@ class FlowSafeSubject(private val actual: Subject) : Observer by /** * The [PreventSubscriptionsSubject] is used to prevent any subscriptions to its underlying [Subject]. */ -class PreventSubscriptionsSubject(private val actual: Subject, errorAction: () -> Unit) : Observer by actual, +class PreventSubscriptionsSubject(private val actual: Subject, errorAction: () -> Exception) : Observer by actual, Subject(OnSubscribe { _ -> - errorAction() + throw errorAction() }) { override fun hasObservers(): Boolean { diff --git a/node/src/main/kotlin/net/corda/node/services/vault/NodeVaultService.kt b/node/src/main/kotlin/net/corda/node/services/vault/NodeVaultService.kt index ac0b5e7cb2..8f33b3f129 100644 --- a/node/src/main/kotlin/net/corda/node/services/vault/NodeVaultService.kt +++ b/node/src/main/kotlin/net/corda/node/services/vault/NodeVaultService.kt @@ -226,7 +226,7 @@ class NodeVaultService( "- aborting the flow " ) - throw FlowException( + FlowException( "Flow ${it.logic::class.java.name} tried to subscribe an Rx.Observer to VaultService.rawUpdates " + "- Rx.Observables should only be subscribed outside the context of a flow " + "- the subscription did not succeed "