Updated on 2026-08-14

This commit is contained in:
Tangem 2022-04-18 17:13:28 +03:00
parent ff282a1d7d
commit 65a55cb5e3
23 changed files with 222 additions and 144 deletions

View file

@ -0,0 +1,8 @@
package com.tangem.common
/**
[REDACTED_AUTHOR]
*/
interface Validator<Data, Error> {
fun validate(data: Data? = null): Error?
}

View file

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

@ -0,0 +1,22 @@
package com.tangem.common.module
/**
[REDACTED_AUTHOR]
* The base object for communication between modules
*/
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?
}