Skip to content

Commit

Permalink
AND-8919 Added sending staking domain error to amplitude.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sateetas committed Oct 29, 2024
1 parent 5d456b5 commit c06ce2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ internal class DefaultStakingErrorResolver(
is StakingError.StakeKitUnknownError -> {
analyticsEventHandler.send(StakingAnalyticsEvent.StakeKitApiUnknownError(error))
}
else -> {
// intentionally do nothing
is StakingError.DomainError -> {
analyticsEventHandler.send(StakingAnalyticsEvent.DomainError(error))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ sealed class StakingAnalyticsEvent(
},
)

data class DomainError(
val stakeKitDomainError: StakingError.DomainError,
) : StakingAnalyticsEvent(
event = "App Errors",
params = buildMap {
addIfValueIsNotNull(AnalyticsParam.ERROR_DESCRIPTION, stakeKitDomainError.message)
},
)

fun MutableMap<String, String>.addIfValueIsNotNull(key: String, value: Any?) {
if (value != null) {
put(key, value.toString())
Expand Down

0 comments on commit c06ce2b

Please sign in to comment.