ContractSpecException

open class ContractSpecException(message: String, val functionName: String? = null, val argumentName: String? = null, val entryName: String? = null, cause: Throwable? = null) : ContractException

Exception thrown when ContractSpec operations fail.

This exception is used for all type conversion and specification-related errors when using com.soneso.stellar.sdk.contract.ContractSpec to convert native Kotlin types to Stellar XDR types.

Usage

throw ContractSpecException.functionNotFound("myFunction")
throw ContractSpecException.argumentNotFound("amount", functionName = "transfer")
throw ContractSpecException.invalidType("Expected Int, got String")

Constructors

Link copied to clipboard
constructor(message: String, functionName: String? = null, argumentName: String? = null, entryName: String? = null, cause: Throwable? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Optional argument name where the error occurred

Link copied to clipboard

The AssembledTransaction that caused the error

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard

Optional spec entry name where the error occurred

Link copied to clipboard

Optional function name where the error occurred

Link copied to clipboard
expect open val message: String?

Functions

Link copied to clipboard
open override fun toString(): String