Video SDKError
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.