I have a method, where I am transforming the paging data models into UIModels.
pagingData
.map { cachedData ->
deserialize(cachedData)
}
.filter {
it.isSuccess
}
.map { it ->
mapToUiModel(it.getOrThrow())
}
The code has 2 potential breaking points, 1st when deserialize happens, 2nd when getOrThrow() happens.
If I put a .catch { } at the end of it, it’s not catching, because the PagingData transformations are happening on another thread, if I put try catch, not catching either.
Any advice?
Thanks,