Add mapping on FocusEventException.

Extract FocusRequestState to its own file and add preview.
This commit is contained in:
Benoit Marty 2024-04-26 16:08:08 +02:00 committed by Benoit Marty
parent d3d5081084
commit a4c6e6c281
10 changed files with 219 additions and 47 deletions

View file

@ -100,7 +100,7 @@ interface MatrixRoom : Closeable {
val liveTimeline: Timeline
suspend fun timelineFocusedOnEvent(eventId: EventId): Timeline
suspend fun timelineFocusedOnEvent(eventId: EventId): Result<Timeline>
fun destroy()

View file

@ -0,0 +1,34 @@
/*
* Copyright (c) 2024 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.element.android.libraries.matrix.api.room.errors
import io.element.android.libraries.matrix.api.core.EventId
sealed class FocusEventException : Exception() {
data class InvalidEventId(
val eventId: String,
val err: String
) : FocusEventException()
data class EventNotFound(
val eventId: EventId
) : FocusEventException()
data class Other(
val msg: String
) : FocusEventException()
}