Skip to content

Replace string-matched chain errors with typed errors #794

Description

@DRadmir

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")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions