Error Event - Android
This event is helpful for development level troubleshooting while integrating SDK.
This event is triggered with a specific error code, name and message whenever an invalid configuration is provided or a server or network error occurs.
The table below lists each constant with its code and message.
| Constant | Code | Message |
|---|---|---|
| INVALID_API_KEY | 4001 | apikey provided in the token is empty or invalid, please verify it on the dashboard. |
| INVALID_TOKEN | 4002 | token is empty or invalid or might have expired. |
| INVALID_ROOM_ID | 4003 | roomId is empty or invalid, please verify it or generate new roomId using the API. |
| INVALID_PARTICIPANT_ID | 4004 | participantId is empty or invalid, it shouldn't contain any whitespaces. |
| DUPLICATE_PARTICIPANT | 4005 | Leaving room, since this participantId joined from another device. |
| ACCOUNT_DEACTIVATED | 4006 | It seems your account is deactivated by VideoSDK for some reason, you can reach out to us at support@videosdk.live. |
| ACCOUNT_DISCONTINUED | 4007 | Server will respond you with specific message. |
| INVALID_PERMISSIONS | 4008 | permissions provided in the token are invalid, please don't use allow_join or allow_mod with ask_join. |
| START_RECORDING_FAILED | 4011 | Recording start request failed due to an unknown error. |
| STOP_RECORDING_FAILED | 4012 | Recording stop request failed due to an unknown error. |
| START_LIVESTREAM_FAILED | 4013 | Livestream start request failed due to an unknown error. |
| STOP_LIVESTREAM_FAILED | 4014 | Livestream stop request failed due to an unknown error. |
| MAX_SPEAKER_LIMIT_REACHED_ON_ORGANIZATION | 4026 | You have reached max speaker limit on organization. To increase contact at support@videosdk.live. |
| MAX_VIEWER_LIMIT_REACHED_ON_ORGANIZATION | 4027 | You have reached max viewer limit on organization. To increase contact at support@videosdk.live. |
| MAX_RECORDING_LIMIT_REACHED_ON_ORGANIZATION | 4028 | You have reached max limit of recording on organization. To increase contact at support@videosdk.live. |
| MAX_HLS_LIMIT_REACHED_ON_ORGANIZATION | 4029 | You have reached max limit of hls on organization. To increase contact at support@videosdk.live. |
| MAX_LIVESTREAM_LIMIT_REACHED_ON_ORGANIZATION | 4030 | You have reached max limit of livestream on organization. To increase contact at support@videosdk.live. |
| INVALID_LIVESTREAM_CONFIG | 4015 | Livestream 'outputs' configuration provided was invalid. |
| PREV_RECORDING_PROCESSING | 4018 | Previous recording session is being processed, please try again after few seconds. |
| RECORDING_FAILED | 5001 | Recording stopped due to an unknown error. |
| LIVESTREAM_FAILED | 5002 | Livestream stopped due to an unknown error. |
| RECORDING_DURATION_LIMIT_REACHED | 5004 | Recording has been automatically stopped by the system, due to max duration limit of 2 hours reached for a single Recording |
| LIVESTREAM_DURATION_LIMIT_REACHED | 5005 | Livestream has been automatically stopped by the system, due to max duration limit of 2 hours reached for a single RTMP |
| HLS_DURATION_LIMIT_REACHED | 5006 | Hls has been automatically stopped by the system, due to max duration limit of 2 hours reached for a single HLS |
For the full list, see Meeting Error Codes.
note
onError()can be called off the main thread. Post to the main thread before you update the UI.- Actions that are
suspendfunctions, such asjoin(), also throw aVideoSDKExceptionwhen they are refused or fail. See Handling errors.
Event Code
private val meetingEventListener: MeetingEventListener = object : MeetingEventListener() {
//..
override fun onError(error: JSONObject) {
try {
val errorCodes: JSONObject = VideoSDK.getErrorCodes()
val code = error.getInt("code")
if (code == errorCodes.getInt("START_LIVESTREAM_FAILED")) {
Log.d("#error", "Error is: " + error["message"])
} else if (code == errorCodes.getInt("START_RECORDING_FAILED")) {
Log.d("#error", "Error is: " + error["message"])
}
} catch (e: Exception) {
e.printStackTrace()
}
}
}
Got a Question? Ask us on discord

