I'm using paging3. My RemoteMediator
returns Result.Error from catch:
catch (e: Exception) {
return MediatorResult.Error(handler.getError(e))
}
Inside fragment I'm listening for state changes:
adapter.addLoadStateListener { loadState ->
// here some code
}
The problem is that I am not getting LoadState.Error
despite what the RemoteMediator returned MediatorResult.Error
. Instead of an LoadState.Error
I get LoadState.NotLoading
.I get the rest of the states correctly.
Why might this be happening? Please help me