NTP-66133 | Divyesh | update notify error handling (#16385)
This commit is contained in:
@@ -589,6 +589,17 @@ class NaviBbpsAnalytics private constructor() {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun alchemistResponseFailureEvent(error: String, sessionAttribute: Map<String, String>) {
|
||||||
|
NaviTrackEvent.trackEventOnClickStream(
|
||||||
|
eventName = "NaviBBPS_Dev_CategoryPage_AlchemistResponseFailure",
|
||||||
|
eventValues =
|
||||||
|
mapOf(
|
||||||
|
"error" to error,
|
||||||
|
NAVI_BBPS_SESSION_ID to sessionAttribute[NAVI_BBPS_SESSION_ID].orEmpty(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inner class BillerList {
|
inner class BillerList {
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import com.navi.bbps.network.di.NaviBbpsGsonBuilder
|
|||||||
import com.navi.common.alchemist.model.AlchemistScreenDefinition
|
import com.navi.common.alchemist.model.AlchemistScreenDefinition
|
||||||
import com.navi.common.constants.DBCacheConstants
|
import com.navi.common.constants.DBCacheConstants
|
||||||
import com.navi.common.di.CoroutineDispatcherProvider
|
import com.navi.common.di.CoroutineDispatcherProvider
|
||||||
|
import com.navi.common.network.models.RepoResult
|
||||||
import com.navi.common.network.models.isSuccessWithData
|
import com.navi.common.network.models.isSuccessWithData
|
||||||
import dagger.Lazy
|
import dagger.Lazy
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
@@ -158,6 +159,8 @@ constructor(
|
|||||||
private val _startOriginBillDetectionFlow = MutableSharedFlow<Boolean>(replay = 1)
|
private val _startOriginBillDetectionFlow = MutableSharedFlow<Boolean>(replay = 1)
|
||||||
val startOriginBillDetectionFlow = _startOriginBillDetectionFlow.asSharedFlow()
|
val startOriginBillDetectionFlow = _startOriginBillDetectionFlow.asSharedFlow()
|
||||||
|
|
||||||
|
private var latestBillCategoriesApiResponse: RepoResult<AlchemistScreenDefinition>? = null
|
||||||
|
|
||||||
internal fun setOnOriginSmsNuxCtaClicked(value: Boolean) {
|
internal fun setOnOriginSmsNuxCtaClicked(value: Boolean) {
|
||||||
viewModelScope.launch(dispatcherProvider.main) { _onOriginSmsNuxCtaClicked.emit(value) }
|
viewModelScope.launch(dispatcherProvider.main) { _onOriginSmsNuxCtaClicked.emit(value) }
|
||||||
}
|
}
|
||||||
@@ -359,10 +362,14 @@ constructor(
|
|||||||
}
|
}
|
||||||
} else if (_billCategoriesStateV2.value !is BillCategoryStateV2.Loaded) {
|
} else if (_billCategoriesStateV2.value !is BillCategoryStateV2.Loaded) {
|
||||||
_billCategoriesStateV2.update { BillCategoryStateV2.Error }
|
_billCategoriesStateV2.update { BillCategoryStateV2.Error }
|
||||||
if (!naviNetworkConnectivity.isInternetConnected()) {
|
latestBillCategoriesApiResponse?.let {
|
||||||
notifyError(errorConfig = getNoInternetErrorConfig())
|
val error = getError(response = it)
|
||||||
} else {
|
notifyError(response = it)
|
||||||
notifyError(errorConfig = getGenericErrorConfig())
|
naviBbpsAnalytics.alchemistResponseFailureEvent(
|
||||||
|
error = error.code,
|
||||||
|
sessionAttribute =
|
||||||
|
naviBbpsSessionHelper.getNaviBbpsSessionAttributes(),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -379,6 +386,8 @@ constructor(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
latestBillCategoriesApiResponse = billCategoriesResponseFromAlchemist
|
||||||
|
|
||||||
if (!billCategoriesResponseFromAlchemist.isSuccessWithData()) {
|
if (!billCategoriesResponseFromAlchemist.isSuccessWithData()) {
|
||||||
return NaviCacheAltSourceEntity(isSuccess = false)
|
return NaviCacheAltSourceEntity(isSuccess = false)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user