Updated on 2026-08-14
This commit is contained in:
parent
298ef986b3
commit
de3d47028a
3 changed files with 8 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ import com.tangem.wallet.R
|
|||
|
||||
interface TapErrors
|
||||
|
||||
interface ArgError{
|
||||
interface ArgError {
|
||||
val args: List<Any>?
|
||||
}
|
||||
|
||||
|
|
@ -21,6 +21,7 @@ sealed class TapError(
|
|||
) : Throwable(), TapErrors, ArgError {
|
||||
|
||||
object UnknownError : TapError(R.string.send_error_unknown)
|
||||
data class CustomError(val customMessage: String) : TapError(R.string.common_custom_string, listOf(customMessage))
|
||||
object PayIdAlreadyCreated : TapError(R.string.wallet_create_payid_error_already_created)
|
||||
object PayIdCreatingError : TapError(R.string.wallet_create_payid_error_message)
|
||||
object PayIdEmptyField : TapError(R.string.wallet_create_payid_empty)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,8 @@ private fun verifyAndSendTransaction(
|
|||
}
|
||||
}
|
||||
is Throwable -> {
|
||||
val message = (result.error as Throwable).message
|
||||
val throwable = result.error as Throwable
|
||||
val message = throwable.message
|
||||
when {
|
||||
message == null -> {
|
||||
dispatch(SendAction.SendError(TapError.UnknownError))
|
||||
|
|
@ -98,8 +99,9 @@ private fun verifyAndSendTransaction(
|
|||
// user was cancelled the operation by closing the Sdk bottom sheet
|
||||
}
|
||||
else -> {
|
||||
Timber.e(result.error)
|
||||
dispatch(SendAction.SendError(TapError.BlockchainInternalError))
|
||||
Timber.e(throwable)
|
||||
FirebaseCrashlytics.getInstance().recordException(throwable)
|
||||
dispatch(SendAction.SendError(TapError.CustomError(message)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
<string name="common_done">Done</string>
|
||||
<string name="common_cancel">Cancel</string>
|
||||
<string name="common_accept">Accept</string>
|
||||
<string name="common_custom_string" translatable="false">%s</string>
|
||||
|
||||
<string name="common_camera_denied_alert_title">Camera access denied</string>
|
||||
<string name="common_camera_denied_alert_message">You have not given access to your camera, please adjust your privacy settings</string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue