Skip to content

Inconsistent error handling in async operations #91

@callebtc

Description

@callebtc

Description:
Some coroutines and background tasks lack proper error handling, leading to silent failures that could confuse users.

Affected Areas:

  • Coroutine operations in CashuWalletManager
  • Background NFC operations in BalanceCheckActivity
  • Network requests without proper error propagation

Issues:

  1. Silent failures in wallet operations
  2. User not informed when background operations fail
  3. Inconsistent error reporting patterns

Fix Instructions:
Add comprehensive error handling to all async operations:

// For coroutines:
scope.launch {
    try {
        // async operation
    } catch (e: Exception) {
        Log.e(TAG, "Operation failed", e)
        // Show user-friendly error message
        showErrorToUser("Operation failed: ${e.localizedMessage}")
    }
}

// For background threads:
Thread {
    try {
        // background operation  
    } catch (e: Exception) {
        Log.e(TAG, "Background operation failed", e)
        runOnUiThread {
            // Update UI with error
        }
    }
}.start()

Priority: High - affects user experience

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions