Logging flow name instead of flow id at VaultService.rawUpdates subscribing error

This commit is contained in:
Kyriakos Tharrouniatis 2020-02-14 11:20:09 +00:00
parent 0fb49e9ed2
commit 9a2daeb5c9
2 changed files with 9 additions and 3 deletions

View File

@ -749,7 +749,11 @@ class VaultObserverExceptionTest {
val flowHandle = aliceNode.rpc.startFlow(ErrorHandling::SubscribingRawUpdatesFlow) val flowHandle = aliceNode.rpc.startFlow(ErrorHandling::SubscribingRawUpdatesFlow)
assertFailsWith<CordaRuntimeException>("Flow ${flowHandle.id} tried to subscribe an Rx.Observer to VaultService.rawUpdates - the subscription did not succeed ") { assertFailsWith<CordaRuntimeException>(
"Flow ${ErrorHandling.SubscribingRawUpdatesFlow::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 "
) {
flowHandle.returnValue.getOrThrow(30.seconds) flowHandle.returnValue.getOrThrow(30.seconds)
} }
} }

View File

@ -218,13 +218,15 @@ class NodeVaultService(
// it could prevent the flow/ fiber -object- get garbage collected. // it could prevent the flow/ fiber -object- get garbage collected.
return PreventSubscriptionsSubject(_rawUpdatesPublisher) { return PreventSubscriptionsSubject(_rawUpdatesPublisher) {
log.error( log.error(
"Flow ${it.id} tried to subscribe an Rx.Observer to VaultService.rawUpdates " + "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 " + "- the subscription did not succeed " +
"- aborting the flow " "- aborting the flow "
) )
throw FlowException( throw FlowException(
"Flow ${it.id} tried to subscribe an Rx.Observer to VaultService.rawUpdates " + "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 " "- the subscription did not succeed "
) )
} }