From 98ce9899ff532db88b1c26817d92b3877908e16d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 29 Aug 2022 17:11:30 +0200 Subject: [PATCH] Fix incorrectly caught exception --- .../vector/app/features/home/room/detail/TimelineViewModel.kt | 2 +- .../im/vector/app/features/home/room/list/RoomListViewModel.kt | 2 +- .../app/features/home/room/list/home/HomeRoomListViewModel.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt index cea845a490..e35a4fdce1 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineViewModel.kt @@ -1046,7 +1046,7 @@ class TimelineViewModel @AssistedInject constructor( val event = try { room.reportingService().reportContent(action.eventId, -100, action.reason) RoomDetailViewEvents.ActionSuccess(action) - } catch (failure: Exception) { + } catch (failure: Throwable) { RoomDetailViewEvents.ActionFailure(action, failure) } _viewEvents.post(event) diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt index 2e0a6ae347..ca64a0f991 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomListViewModel.kt @@ -271,7 +271,7 @@ class RoomListViewModel @AssistedInject constructor( viewModelScope.launch { try { room.roomPushRuleService().setRoomNotificationState(action.notificationState) - } catch (failure: Exception) { + } catch (failure: Throwable) { _viewEvents.post(RoomListViewEvents.Failure(failure)) } } diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListViewModel.kt index 5ecf9d6d96..425f309202 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListViewModel.kt @@ -289,7 +289,7 @@ class HomeRoomListViewModel @AssistedInject constructor( viewModelScope.launch { try { room.roomPushRuleService().setRoomNotificationState(action.notificationState) - } catch (failure: Exception) { + } catch (failure: Throwable) { _viewEvents.post(HomeRoomListViewEvents.Failure(failure)) } }