NTP-67834 crash handling due to bill calendar config api exception (#16352)

This commit is contained in:
Hitesh Kumar
2025-05-28 12:20:06 +05:30
committed by GitHub
parent dfd09d0b3c
commit f8cff85ec6

View File

@@ -215,14 +215,25 @@ class RemoteDataProviderImpl @Inject constructor(private val retrofitService: Re
}
override suspend fun fetchBillCalendarConfig(): RepoResult<BillCalendarConfigResponse> {
return apiResponseCallback(
response = retrofitService.fetchBillCalendarConfig(),
metricInfo =
MetricInfo.AppMetric(
screen = MMScreen.BILL_CALENDAR_SCREEN.screen,
isNae = { false },
),
)
val response: RepoResult<BillCalendarConfigResponse> =
try {
apiResponseCallback(
response = retrofitService.fetchBillCalendarConfig(),
metricInfo =
MetricInfo.AppMetric(
screen = MMScreen.BILL_CALENDAR_SCREEN.screen,
isNae = { false },
),
)
} catch (e: Exception) {
e.log()
RepoResult(
data = null,
error = ErrorMessage(message = e.message, statusCode = API_WRONG_ERROR_RESPONSE),
)
}
return response
}
override suspend fun markBillAsPaid(billId: String): RepoResult<BillCalendarResponse> {