Sep30Exception
Base exception class for SEP-30 Account Recovery errors.
All SEP-30-specific exceptions extend this class to enable unified error handling while providing specific error types for different failure scenarios.
This exception hierarchy maps directly to HTTP status codes returned by recovery servers, allowing applications to handle errors at different levels:
Catch Sep30Exception for general SEP-30 error handling
Catch specific subclasses for precise error recovery
Common error scenarios:
Sep30BadRequestException: Recovery server returned HTTP 400 (invalid request parameters)
Sep30UnauthorizedException: Recovery server returned HTTP 401 (missing or invalid authentication)
Sep30NotFoundException: Recovery server returned HTTP 404 (account not found)
Sep30ConflictException: Recovery server returned HTTP 409 (account already registered)
Sep30UnknownResponseException: Recovery server returned an unexpected HTTP status code
Sep30InvalidResponseException: Recovery server returned HTTP 200 with malformed body
Example - General error handling:
try {
val account = sep30Service.registerAccount(address, identities, signers)
} catch (e: Sep30UnauthorizedException) {
println("Authentication failed: ${e.message}")
} catch (e: Sep30Exception) {
println("SEP-30 error: ${e.message}")
}See also: