Improve the logs for TimelineException.CannotPaginate (#1708)

This commit is contained in:
Jorge Martin Espinosa 2023-10-31 16:43:18 +01:00 committed by GitHub
parent c377656354
commit 3bbaf8e5e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -194,8 +194,12 @@ class RustMatrixTimeline(
waitForToken = true,
)
innerRoom.paginateBackwards(paginationOptions)
}.onFailure {
Timber.d(it, "Fail to paginate for room ${matrixRoom.roomId}")
}.onFailure { error ->
if (error is TimelineException.CannotPaginate) {
Timber.d("Can't paginate backwards on room ${matrixRoom.roomId}, we're already at the start")
} else {
Timber.e(error, "Error paginating backwards on room ${matrixRoom.roomId}")
}
}.onSuccess {
Timber.v("Success back paginating for room ${matrixRoom.roomId}")
}