From 095216349eeff6caf65e5cb6f271a643c1c215cb Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 10 Jan 2020 18:35:29 +0100 Subject: [PATCH] Exception -> Throwable --- .../home/room/detail/timeline/factory/DefaultItemFactory.kt | 4 ++-- .../room/detail/timeline/factory/TimelineItemFactory.kt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/DefaultItemFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/DefaultItemFactory.kt index 94d7812512..d9bed98b1f 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/DefaultItemFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/DefaultItemFactory.kt @@ -47,8 +47,8 @@ class DefaultItemFactory @Inject constructor(private val avatarSizeProvider: Ava fun create(event: TimelineEvent, highlight: Boolean, callback: TimelineEventController.Callback?, - exception: Exception? = null): DefaultItem { - val text = if (exception == null) { + throwable: Throwable? = null): DefaultItem { + val text = if (throwable == null) { "${event.root.getClearType()} events are not yet handled" } else { "an exception occurred when rendering the event ${event.root.eventId}" diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/TimelineItemFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/TimelineItemFactory.kt index 232b61b3a6..6d27cf7211 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/TimelineItemFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/TimelineItemFactory.kt @@ -76,9 +76,9 @@ class TimelineItemFactory @Inject constructor( null } } - } catch (e: Exception) { - Timber.e(e, "failed to create message item") - defaultItemFactory.create(event, highlight, callback, e) + } catch (throwable: Throwable) { + Timber.e(throwable, "failed to create message item") + defaultItemFactory.create(event, highlight, callback, throwable) } return (computedModel ?: EmptyItem_()) }