Sep24Transaction Not Found Exception
Exception thrown when a SEP-24 transaction is not found (HTTP 404).
Indicates that the requested transaction ID does not exist or is not accessible to the authenticated user. This error typically occurs when:
Transaction ID does not exist
Transaction belongs to a different user account
Invalid transaction ID format
Transaction has been purged from the anchor's system
Recovery actions:
Verify the transaction ID is correct
Ensure the authenticated account owns the transaction
Check transaction history for valid transaction IDs
Initiate a new deposit or withdrawal if the transaction is no longer available
Example - Handle transaction not found:
suspend fun getTransactionStatus(
sep24Service: Sep24Service,
transactionId: String,
jwt: String
): Sep24TransactionResponse? {
try {
return sep24Service.getTransaction(transactionId, jwt)
} catch (e: Sep24TransactionNotFoundException) {
println("Transaction not found: ${e.transactionId ?: transactionId}")
return null
}
}Content copied to clipboard
Example - List transactions instead:
suspend fun findTransaction(
sep24Service: Sep24Service,
transactionId: String,
assetCode: String,
jwt: String
): Sep24TransactionResponse? {
try {
return sep24Service.getTransaction(transactionId, jwt)
} catch (e: Sep24TransactionNotFoundException) {
println("Transaction ${e.transactionId} not found, checking history...")
// Fall back to listing transactions
val transactions = sep24Service.getTransactions(assetCode, jwt)
return transactions.find { it.id == transactionId }
}
}Content copied to clipboard
See also:
Sep24Exception base class