mirror of
https://github.com/corda/corda.git
synced 2025-02-25 19:11:45 +00:00
Change PreventSubscriptionsSubject#errorAction to be more specific; to return an Exception
This commit is contained in:
parent
2c0e4396d1
commit
2fffef5701
@ -40,9 +40,9 @@ class FlowSafeSubject<T, R>(private val actual: Subject<T, R>) : Observer<T> by
|
|||||||
/**
|
/**
|
||||||
* The [PreventSubscriptionsSubject] is used to prevent any subscriptions to its underlying [Subject].
|
* The [PreventSubscriptionsSubject] is used to prevent any subscriptions to its underlying [Subject].
|
||||||
*/
|
*/
|
||||||
class PreventSubscriptionsSubject<T, R>(private val actual: Subject<T, R>, errorAction: () -> Unit) : Observer<T> by actual,
|
class PreventSubscriptionsSubject<T, R>(private val actual: Subject<T, R>, errorAction: () -> Exception) : Observer<T> by actual,
|
||||||
Subject<T, R>(OnSubscribe<R> { _ ->
|
Subject<T, R>(OnSubscribe<R> { _ ->
|
||||||
errorAction()
|
throw errorAction()
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
override fun hasObservers(): Boolean {
|
override fun hasObservers(): Boolean {
|
||||||
|
@ -226,7 +226,7 @@ class NodeVaultService(
|
|||||||
"- aborting the flow "
|
"- aborting the flow "
|
||||||
)
|
)
|
||||||
|
|
||||||
throw FlowException(
|
FlowException(
|
||||||
"Flow ${it.logic::class.java.name} 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 " +
|
"- Rx.Observables should only be subscribed outside the context of a flow " +
|
||||||
"- the subscription did not succeed "
|
"- the subscription did not succeed "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user