Updated on 2026-08-14

This commit is contained in:
Tangem 2022-10-25 16:38:52 +05:00
commit 707f04c6a5
232 changed files with 7456 additions and 1908 deletions

View file

@ -0,0 +1,8 @@
package com.tangem.common
/**
[REDACTED_AUTHOR]
*/
interface Filter<T> {
fun filter(value: T): Boolean
}

View file

@ -0,0 +1,13 @@
package com.tangem.common.module
/**
[REDACTED_AUTHOR]
*/
object ModuleErrorCode {
const val APP = 100000
const val COMMON = 10000
const val NETWORK = 20000
const val DOMAIN = 30000
const val SALT_PAY = 40000
}

View file

@ -1,14 +0,0 @@
package com.tangem.common.module
/**
[REDACTED_AUTHOR]
* A module exception
*/
interface ModuleException {
val message: String
}
/**
* An exception marked as FbConsumeException should be submitted to Firebase.Crashlytics as a non-fatal issue.
*/
interface FbConsumeException

View file

@ -6,17 +6,22 @@ package com.tangem.common.module
*/
interface ModuleMessage
interface ModuleMessageConverter<ModuleMessage, R> {
fun convert(message: ModuleMessage): R
}
/**
* @property code describes what feature is the error coming from
* @property message the error description
* @property data any data that can help in the part where this error is being handled
*/
interface ModuleError : ModuleMessage {
val code: Int
val message: String
val data: Any?
abstract class ModuleError() : Throwable(), ModuleMessage {
abstract val code: Int
abstract override val message: String
abstract val data: Any?
}
/**
* An exception marked as FbConsumeException should be submitted to Firebase.Crashlytics as a non-fatal issue.
*/
interface FbConsumeException
interface ModuleMessageConverter<ModuleMessage, R> {
fun convert(message: ModuleMessage): R
}