On both iOS and Android the app recognizes blockchain errors by searching for text fragments inside the error message, which is fragile and silently breaks whenever the wording changes in core. Core should surface these failures as typed error values so both apps can match on a stable case instead of parsing strings. This should at least cover the dust threshold and insufficient balance cases that are string-matched today.
Current string matching:
- iOS:
ChainCoreError.fromError in ios/Packages/Blockchain/Sources/ChainCoreError.swift (description.contains("dust threshold"), contains("insufficient balance"))
- Android:
toPreloadConfirmError in android/features/confirm/viewmodels/src/main/kotlin/com/gemwallet/android/features/confirm/viewmodels/ConfirmErrorMapper.kt (matches GemPlatformErrors.Dust = "dust_error")
On both iOS and Android the app recognizes blockchain errors by searching for text fragments inside the error message, which is fragile and silently breaks whenever the wording changes in core. Core should surface these failures as typed error values so both apps can match on a stable case instead of parsing strings. This should at least cover the dust threshold and insufficient balance cases that are string-matched today.
Current string matching:
ChainCoreError.fromErrorinios/Packages/Blockchain/Sources/ChainCoreError.swift(description.contains("dust threshold"),contains("insufficient balance"))toPreloadConfirmErrorinandroid/features/confirm/viewmodels/src/main/kotlin/com/gemwallet/android/features/confirm/viewmodels/ConfirmErrorMapper.kt(matchesGemPlatformErrors.Dust = "dust_error")