From 1319da6b5055bc6aa33f3eb4efdd49ba640d913b Mon Sep 17 00:00:00 2001 From: Kyriakos Tharrouniatis Date: Mon, 17 Feb 2020 13:58:53 +0000 Subject: [PATCH] Changing exception thrown when accessing VaultService.rawUpdates from within a flow to a CordaRuntimeException --- .../corda/node/services/vault/VaultObserverExceptionTest.kt | 4 ++-- .../kotlin/net/corda/node/services/vault/NodeVaultService.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/node/src/integration-test/kotlin/net/corda/node/services/vault/VaultObserverExceptionTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/vault/VaultObserverExceptionTest.kt index 77f913b5cf..98447f6a31 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/vault/VaultObserverExceptionTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/vault/VaultObserverExceptionTest.kt @@ -9,9 +9,9 @@ import com.r3.dbfailure.workflows.DbListenerService.MakeServiceThrowErrorFlow import com.r3.dbfailure.workflows.SendStateFlow import com.r3.transactionfailure.workflows.ErrorHandling import com.r3.transactionfailure.workflows.ErrorHandling.CheckpointAfterErrorFlow +import net.corda.core.CordaRuntimeException import net.corda.core.contracts.StateAndRef import net.corda.core.contracts.UniqueIdentifier -import net.corda.core.flows.FlowException import net.corda.core.flows.FlowLogic import net.corda.core.flows.StartableByRPC import net.corda.core.identity.Party @@ -751,7 +751,7 @@ class VaultObserverExceptionTest { val flowHandle = aliceNode.rpc.startFlow(::SubscribingRawUpdatesFlow) - assertFailsWith( + assertFailsWith( "Flow ${SubscribingRawUpdatesFlow::class.java.name} tried to access VaultService.rawUpdates " + "- Rx.Observables should only be accessed to outside the context of a flow " ) { 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 e5526b283c..1cd7e6c234 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 @@ -2,10 +2,10 @@ package net.corda.node.services.vault import co.paralleluniverse.fibers.Suspendable import co.paralleluniverse.strands.Strand +import net.corda.core.CordaRuntimeException import net.corda.core.contracts.* import net.corda.core.crypto.SecureHash import net.corda.core.crypto.containsAny -import net.corda.core.flows.FlowException import net.corda.core.flows.HospitalizeFlowException import net.corda.core.internal.* import net.corda.core.messaging.DataFeed @@ -223,7 +223,7 @@ class NodeVaultService( "- aborting the flow " ) - throw FlowException( + throw CordaRuntimeException( "Flow ${it.logic::class.java.name} tried to access VaultService.rawUpdates " + "- Rx.Observables should only be accessed to outside the context of a flow " )