mirror of
https://github.com/corda/corda.git
synced 2024-12-20 21:43:14 +00:00
ENT-4090: move startFlow into try block so exception is caught and managed (#5519)
This commit is contained in:
parent
9c8048008f
commit
be6824dac4
@ -20,7 +20,6 @@ import net.corda.core.contracts.withoutIssuer
|
||||
import net.corda.core.flows.FlowException
|
||||
import net.corda.core.identity.Party
|
||||
import net.corda.core.identity.PartyAndCertificate
|
||||
import net.corda.core.messaging.FlowHandle
|
||||
import net.corda.core.messaging.startFlow
|
||||
import net.corda.core.transactions.SignedTransaction
|
||||
import net.corda.core.utilities.OpaqueBytes
|
||||
@ -94,15 +93,14 @@ class NewTransaction : Fragment() {
|
||||
initOwner(window)
|
||||
show()
|
||||
}
|
||||
val handle: FlowHandle<AbstractCashFlow.Result> = when (request) {
|
||||
runAsync {
|
||||
try {
|
||||
when (request) {
|
||||
is IssueAndPaymentRequest -> rpcProxy.value!!.startFlow(::CashIssueAndPaymentFlow, request)
|
||||
is PaymentRequest -> rpcProxy.value!!.startFlow(::CashPaymentFlow, request)
|
||||
is ExitRequest -> rpcProxy.value!!.startFlow(::CashExitFlow, request)
|
||||
else -> throw IllegalArgumentException("Unexpected request type: $request")
|
||||
}
|
||||
runAsync {
|
||||
try {
|
||||
handle.returnValue.getOrThrow()
|
||||
}.returnValue.getOrThrow()
|
||||
} finally {
|
||||
dialog.dialogPane.isDisable = false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user