Skip to content

Commit d34e3aa

Browse files
authored
Merge pull request #445 from code-payments/chore/add-catch-all-for-cashlinks
chore: add catch all error for cash link collection
2 parents e73c7b8 + df0d251 commit d34e3aa

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

app/src/main/java/com/getcode/view/main/home/HomeViewModel.kt

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,26 +1559,15 @@ class HomeViewModel @Inject constructor(
15591559
removeLinkWithDelay(base58Entropy)
15601560
}
15611561
} catch (ex: Exception) {
1562-
ex.printStackTrace()
1563-
Timber.e(ex)
1564-
when (ex) {
1565-
is RemoteSendException -> {
1566-
onRemoteSendError(ex)
1567-
removeLinkWithDelay(base58Entropy)
1568-
}
1569-
1570-
else -> {
1571-
ErrorUtils.handleError(ex)
1572-
}
1573-
}
1562+
onRemoteSendError(ex)
15741563
}
15751564
}
15761565
}
15771566
}
15781567
} catch (e: Base58.AddressFormatException.InvalidCharacter) {
1579-
ErrorUtils.handleError(e)
1568+
onRemoteSendError(e)
15801569
} catch (e: Exception) {
1581-
ErrorUtils.handleError(e)
1570+
onRemoteSendError(e)
15821571
}
15831572
}
15841573

@@ -1598,7 +1587,15 @@ class HomeViewModel @Inject constructor(
15981587
)
15991588

16001589
else -> {
1601-
ErrorUtils.handleError(throwable)
1590+
TopBarManager.showMessage(
1591+
getString(R.string.error_title_failedToCollect),
1592+
getString(R.string.error_description_failedToCollect)
1593+
)
1594+
val traceableError = Throwable(
1595+
message = "Failed to receive remote send",
1596+
cause = throwable
1597+
)
1598+
ErrorUtils.handleError(traceableError)
16021599
}
16031600
}
16041601
}

app/src/main/res/values/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,8 @@
3939
<string name="action_tapToShareDownloadLink">Tap the Code logo to share the app download link</string>
4040
<string name="title_scanToDownloadCode">Scan to download the Code Wallet app</string>
4141
<string name="action_resetTooltips">Reset Tooltips</string>
42+
43+
<string name="error_title_failedToCollect">Failed to Collect</string>
44+
<string name="error_description_failedToCollect">Something went wrong. This Kin could not be collected.</string>
45+
4246
</resources>

0 commit comments

Comments
 (0)