Fix incorrectly caught exception

This commit is contained in:
Benoit Marty 2022-08-29 17:11:30 +02:00 committed by Benoit Marty
parent 657796c8b5
commit 98ce9899ff
3 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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))
}
}

View File

@ -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))
}
}