Sep06Exception

open class Sep06Exception(message: String, cause: Throwable? = null) : Exception

Base exception class for SEP-6 Deposit and Withdrawal API errors.

All SEP-6-specific exceptions extend this class to enable unified error handling while providing specific error types for different failure scenarios.

This exception hierarchy allows applications to handle transfer errors at different levels:

  • Catch Sep06Exception for general SEP-6 error handling

  • Catch specific subclasses for precise error recovery

Common error scenarios:

Example - General error handling:

try {
val response = sep06Service.deposit(request, jwt)
} catch (e: Sep06AuthenticationRequiredException) {
// Re-authenticate via SEP-10
println("Authentication required, please re-authenticate")
} catch (e: Sep06CustomerInformationNeededException) {
// Collect additional KYC fields
println("Additional fields required: ${e.fields.joinToString()}")
} catch (e: Sep06InvalidRequestException) {
// Invalid request parameters
println("Bad request: ${e.errorMessage}")
} catch (e: Sep06Exception) {
// Other SEP-6 errors
println("Transfer error: ${e.message}")
}

See also:

Inheritors

Constructors

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

Properties

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

Functions

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