VideoSDKError

class VideoSDKError(val code: Int, val name: String, val message: String)

Every error the SDK can report, and the code you match on to handle it.

An error reaches an app two ways, and most reach it both: thrown from the call that failed as a VideoSDKException, and delivered to RoomEventListener.onError. Four describe what the caller asked for rather than a fault in the room, so the room actions only throw them: ERROR_MEDIA_NOT_READY, ERROR_ACTION_NOT_SUPPORTED_IN_MODE, ERROR_PAYLOAD_TOO_LARGE and ERROR_INVALID_PARAMETER. The one exception is VideoSDK.createScreenShareVideoTrack, which returns null instead of throwing and reports ERROR_MEDIA_NOT_READY on onError.

The number tells you where the fault is, which is usually what decides the fix:

  • 3xxx — found on the device. Permissions, cameras and microphones, and calls made in the wrong order. Fix it in the app.

  • 4xxx — refused by the server. Tokens, account limits, and requests that did not go through. Check the token or the dashboard.

  • 5xxx — something already running stopped, such as a recording or an HLS stream.

override fun onError(error: VideoSDKError) {
when (error) {
VideoSDKError.INVALID_TOKEN -> refreshTokenAndRejoin()
VideoSDKError.ERROR_CAMERA_IN_USE -> showBanner("Another app is using the camera")
else -> log(error.message)
}
}

Two errors are equal when their codes are, so an error delivered with the server's own message still matches its catalogue constant. The constants carry the SDK's default wording; branch on the code and log the message. VideoSDK.getErrorCodes returns the whole catalogue as a name-to-code map.

Constructors

Link copied to clipboard
constructor(code: Int, name: String, message: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val code: Int

the numeric code, stable across VideoSDK's platforms.

Link copied to clipboard

the reason: the server's wording when it sent one, else the catalogue's.

Link copied to clipboard

the catalogue name, for example "ERROR_ROOM_RECONNECTING"; empty for a code this SDK version does not know that arrived without one.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String