Updated on 2026-08-14
This commit is contained in:
parent
ded577faff
commit
aea7f5f415
21 changed files with 220 additions and 136 deletions
|
|
@ -1,14 +1,4 @@
|
|||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
alias(deps.plugins.kotlin.jvm)
|
||||
id("configuration")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.tangem.core.error"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(tangemDeps.card.core)
|
||||
implementation(tangemDeps.blockchain)
|
||||
}
|
||||
1
core/error/ext/.gitignore
vendored
Normal file
1
core/error/ext/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/build
|
||||
16
core/error/ext/build.gradle.kts
Normal file
16
core/error/ext/build.gradle.kts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
id("configuration")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.tangem.core.error.ext"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(projects.core.error)
|
||||
|
||||
implementation(tangemDeps.card.core)
|
||||
implementation(tangemDeps.blockchain)
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.tangem.core.error.ext
|
||||
|
||||
import com.tangem.common.core.TangemSdkError
|
||||
import com.tangem.blockchain.common.BlockchainSdkError
|
||||
import com.tangem.common.core.TangemError
|
||||
import com.tangem.core.error.UniversalError
|
||||
|
||||
val TangemError.universalError: UniversalError
|
||||
get() = when (this) {
|
||||
is TangemSdkError -> object : UniversalError {
|
||||
override val errorCode: Int = 101000000 + code
|
||||
}
|
||||
else -> object : UniversalError {
|
||||
override val errorCode: Int = code
|
||||
}
|
||||
}
|
||||
|
||||
val BlockchainSdkError.universalError: UniversalError
|
||||
get() = object : UniversalError {
|
||||
override val errorCode: Int = 102000000 + code
|
||||
}
|
||||
|
||||
val UniversalError.tangemError: TangemError
|
||||
get() = object : TangemError(errorCode) {
|
||||
override var customMessage: String = errorCode.toString()
|
||||
override val messageResId: Int? = null
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.tangem.core.error
|
||||
|
||||
import com.tangem.common.core.TangemSdkError
|
||||
import com.tangem.blockchain.common.BlockchainSdkError
|
||||
|
||||
val TangemSdkError.universalError: UniversalError
|
||||
get() = object : UniversalError {
|
||||
override val errorCode: Int = 101000000 + code
|
||||
}
|
||||
|
||||
val BlockchainSdkError.universalError: UniversalError
|
||||
get() = object : UniversalError {
|
||||
override val errorCode: Int = 102000000 + code
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue