Sep02Exception
Base exception class for SEP-2 Federation Protocol errors.
All SEP-2-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 federation errors at different levels:
Catch Sep02Exception for general SEP-2 error handling
Catch specific subclasses for precise error recovery
Common error scenarios:
Sep02InvalidAddressException: Malformed Stellar address format (missing *, empty parts, multiple *)
Sep02FederationNotFoundException: stellar.toml does not contain FEDERATION_SERVER field
Sep02InvalidResponseException: Malformed federation server response, missing required fields, or HTTP errors
Example - General error handling:
try {
val response = federationService.resolveStellarAddress("user*example.com")
} catch (e: Sep02InvalidAddressException) {
println("Invalid address format: ${e.message}")
} catch (e: Sep02Exception) {
println("SEP-2 error: ${e.message}")
}See also:
Sep02InvalidAddressException for address format errors
Sep02FederationNotFoundException for missing federation server configuration
Sep02InvalidResponseException for malformed server responses