Sep45Exception

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

Base exception for all SEP-45 Web Authentication for Contracts errors.

All exceptions thrown by com.soneso.stellar.sdk.sep.sep45.WebAuthForContracts extend this class, allowing client code to catch all SEP-45 errors with a single catch block when needed.

SEP-45 authentication is security-critical. Always handle exceptions appropriately and never silently ignore authentication failures.

SEP-45 complements SEP-10 by providing authentication for contract accounts (C... addresses) instead of traditional Stellar accounts (G... and M... addresses).

Example - Catch all SEP-45 errors:

try {
val webAuth = WebAuthForContracts.fromDomain("example.com", Network.PUBLIC)
val token = webAuth.jwtToken(contractAccountId, signers)
} catch (e: Sep45Exception) {
// Handle any SEP-45 authentication error
logger.error("Contract authentication failed: ${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?