VideoSDKException

open class VideoSDKException(val code: Int, val name: String, message: String) : RuntimeException

Thrown when an action is refused or fails — by the suspending methods on Room, Participant and RTCStream, and by the VideoSDK methods whose docs list it.

It is unchecked, so catching it is opt-in. Branch on code against the VideoSDKError catalogue rather than on the message text, which the server can override:

lifecycleScope.launch {
try {
room.unmuteMic()
} catch (e: VideoSDKException) {
when (e.error) {
VideoSDKError.ERROR_OPERATION_IN_PROGRESS -> Unit // a mic toggle is already running
VideoSDKError.ERROR_MICROPHONE_ACCESS_DENIED_OR_DISMISSED -> requestMicPermission()
else -> showError(e.message)
}
}
}

Most failures are also announced on RoomEventListener.onError; see VideoSDKError for the ones that are only thrown.

Constructors

Link copied to clipboard
constructor(error: VideoSDKError)

Wraps a VideoSDKError, keeping its message.

constructor(code: Int, name: String, message: String)

Properties

Link copied to clipboard
val code: Int

the numeric VideoSDKError code, for example 3055.

Link copied to clipboard

This failure as a VideoSDKError, carrying this exception's message.

Link copied to clipboard

the matching catalogue name, for example "ERROR_OPERATION_IN_PROGRESS".

Functions

Link copied to clipboard
open override fun toString(): String