From 06514d8be510363c8005966bcdc0bb3ce0888606 Mon Sep 17 00:00:00 2001 From: Jorge Martin Espinosa Date: Tue, 31 Oct 2023 16:43:18 +0100 Subject: [PATCH] Improve the logs for `TimelineException.CannotPaginate` (#1708) --- .../libraries/matrix/impl/timeline/RustMatrixTimeline.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/RustMatrixTimeline.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/RustMatrixTimeline.kt index 1f0d13c9bf..74ad10ad26 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/RustMatrixTimeline.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/timeline/RustMatrixTimeline.kt @@ -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}") }