Updated on 2026-08-14
This commit is contained in:
parent
84e5496689
commit
123f8b2e34
25 changed files with 411 additions and 296 deletions
8
common/src/main/java/com/tangem/common/Filter.kt
Normal file
8
common/src/main/java/com/tangem/common/Filter.kt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
package com.tangem.common
|
||||
|
||||
/**
|
||||
[REDACTED_AUTHOR]
|
||||
*/
|
||||
interface Filter<T> {
|
||||
fun filter(value: T): Boolean
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue