Updated on 2026-08-14

This commit is contained in:
Tangem 2025-03-28 12:03:09 +03:00
parent 80d4eeaed9
commit 375afeea12
8 changed files with 78 additions and 0 deletions

1
core/error/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build

View file

@ -0,0 +1,14 @@
plugins {
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
id("configuration")
}
android {
namespace = "com.tangem.core.error"
}
dependencies {
implementation(tangemDeps.card.core)
implementation(tangemDeps.blockchain)
}

View file

@ -0,0 +1,23 @@
package com.tangem.core.error
/**
* Universal error interface for all errors in the app.
* Each error code must follow this format: xxxyyyzzz where
* xxx - Feature code
* yyy - Subsystem code
* zzz - Specific error code
* If you need to add new feature add it to list below incrementing last code.
*
* Features:
* `100` - App error
* `101` - TangemSdkError
* `102` - BlockchainSdkError
* `103` - Express
* `104` - Visa
* `105` - Staking
* `106` - NFT
* `107` - WalletConnect
*/
interface UniversalError {
val errorCode: Int
}

View file

@ -0,0 +1,14 @@
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
}