Updated on 2026-08-14
This commit is contained in:
parent
505400888d
commit
230aff6ed6
5 changed files with 34 additions and 29 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
|
|
@ -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 -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue