corda / net.corda.core.flows / FlowException

FlowException

open class FlowException : CordaException, IdentifiableException

Exception which can be thrown by a FlowLogic at any point in its logic to unexpectedly bring it to a permanent end. The exception will propagate to all counterparty flows and will be thrown on their end the next time they wait on a FlowSession.receive or FlowSession.sendAndReceive. Any flow which no longer needs to do a receive, or has already ended, will not receive the exception (if this is required then have them wait for a confirmation message).

If the rethrown FlowException is uncaught in counterparty flows and propagation triggers then the exception is downgraded to an UnexpectedFlowEndException. This means only immediate counterparty flows will receive information about what the exception was.

FlowException (or a subclass) can be a valid expected response from a flow, particularly ones which act as a service. It is recommended a FlowLogic document the FlowException types it can throw.

Constructors

<init>

FlowException(message: String?, cause: Throwable?)
FlowException(message: String?)
FlowException(cause: Throwable?)
FlowException()FlowException(message: String?, cause: Throwable?, originalErrorId: Long? = null)

Exception which can be thrown by a FlowLogic at any point in its logic to unexpectedly bring it to a permanent end. The exception will propagate to all counterparty flows and will be thrown on their end the next time they wait on a FlowSession.receive or FlowSession.sendAndReceive. Any flow which no longer needs to do a receive, or has already ended, will not receive the exception (if this is required then have them wait for a confirmation message).

Properties

originalErrorId

var originalErrorId: Long?

the ID backing getErrorId. If null it will be set dynamically by the flow framework when the exception is handled. This ID is propagated to counterparty flows, even when the FlowException is downgraded to an UnexpectedFlowEndException. This is so the error conditions may be correlated later on.

Inherited Properties

cause

open val cause: Throwable?

message

open val message: String?

originalExceptionClassName

open var originalExceptionClassName: String?

originalMessage

open val originalMessage: String?

Functions

getErrorId

open fun getErrorId(): Long?

Inherited Functions

addSuppressed

open fun addSuppressed(suppressed: Array<Throwable>): Unit

equals

open fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

setCause

open fun setCause(cause: Throwable?): Unit

setMessage

open fun setMessage(message: String?): Unit

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.

Inheritors

AssetMismatchException

class AssetMismatchException : FlowException

AttachmentResolutionException

class AttachmentResolutionException : FlowException

The node asked a remote peer for the attachment identified by hash because it is a dependency of a transaction being resolved, but the remote peer would not provide it.

AttachmentResolutionException

class AttachmentResolutionException : FlowException

CashException

class CashException : FlowException

DoubleSpentInputs

class DoubleSpentInputs : FlowException

DuplicateOutputLabel

class DuplicateOutputLabel : FlowException

InsufficientBalanceException

class InsufficientBalanceException : FlowException

MissingContractAttachments

class MissingContractAttachments : FlowException

A contract attachment was missing when trying to automatically attach all known contract attachments

NotaryException

class NotaryException : FlowException

Exception thrown by the notary service if any issues are encountered while trying to commit a transaction. The underlying error specifies the cause of failure.

StateReplacementException

open class StateReplacementException : FlowException

StatesNotAvailableException

class StatesNotAvailableException : FlowException

TransactionResolutionException

class TransactionResolutionException : FlowException

The node asked a remote peer for the transaction identified by hash because it is a dependency of a transaction being resolved, but the remote peer would not provide it.

TransactionVerificationException

sealed class TransactionVerificationException : FlowException

Indicates that some aspect of the transaction named by txId violates the platform rules. The exact type of failure is expressed using a subclass. TransactionVerificationException is a FlowException and thus when thrown inside a flow, the details of the failure will be serialised, propagated to the peer and rethrown.

UnacceptablePriceException

class UnacceptablePriceException : FlowException

UnknownCalendar

class UnknownCalendar : FlowException

VaultQueryException

class VaultQueryException : FlowException