Updated on 2026-08-14

This commit is contained in:
Tangem 2024-04-11 16:09:32 +05:00
parent 505400888d
commit 230aff6ed6
5 changed files with 34 additions and 29 deletions

View file

@ -8,7 +8,7 @@ sealed class SendTransactionError {
data class DataError(val message: String?) : SendTransactionError()
data class NetworkError(val message: String?) : SendTransactionError()
data class NetworkError(val message: String?, val code: String?) : SendTransactionError()
data class BlockchainSdkError(val code: Int, val message: String?) : SendTransactionError()

View file

@ -67,7 +67,12 @@ class SendTransactionUseCase(
}
private fun handleError(result: SimpleResult.Failure): SendTransactionError {
if (ResultChecker.isNetworkError(result)) return SendTransactionError.NetworkError(result.error.message)
if (ResultChecker.isNetworkError(result)) {
return SendTransactionError.NetworkError(
code = result.error.message,
message = result.error.customMessage,
)
}
val error = result.error as? BlockchainSdkError ?: return SendTransactionError.UnknownError()
return when (error) {
is BlockchainSdkError.WrappedTangemError -> {