mirror of
https://github.com/corda/corda.git
synced 2025-01-18 18:56:28 +00:00
CORDA-1644: Add a more descriptive error message when the notary type is mis-configured.
This commit is contained in:
parent
02348a584d
commit
366af50150
@ -61,12 +61,18 @@ data class NotarisationPayload(val transaction: Any, val requestSignature: Notar
|
||||
* A helper for automatically casting the underlying [transaction] payload to a [SignedTransaction].
|
||||
* Should only be used by validating notaries.
|
||||
*/
|
||||
val signedTransaction get() = transaction as SignedTransaction
|
||||
val signedTransaction get() = transaction as? SignedTransaction ?: throw exception()
|
||||
|
||||
/**
|
||||
* A helper for automatically casting the underlying [transaction] payload to a [CoreTransaction].
|
||||
* Should only be used by non-validating notaries.
|
||||
*/
|
||||
val coreTransaction get() = transaction as CoreTransaction
|
||||
val coreTransaction get() = transaction as? CoreTransaction ?: throw exception()
|
||||
|
||||
private fun exception() = IllegalArgumentException("Unexpected transaction type in the notarisation payload: " +
|
||||
"${transaction::class.java}, it may be that there is a discrepancy between the configured notary type " +
|
||||
"(validating/non-validating) and the one advertised on the network parameters."
|
||||
)
|
||||
}
|
||||
|
||||
/** Payload returned by the notary service flow to the client. */
|
||||
|
Loading…
Reference in New Issue
Block a user