ErrorCodeType

Error codes.

Error codes indicate that the SDK encountered an unrecoverable error and requires intervention from the application. For example, an error is returned when the camera fails to open, and the app needs to inform the user that the camera cannot be used.

Enumerations

ErrOk
0: No error.
ErrFailed
1: A general error (no specific classification). Please retry the method call.
ErrInvalidArgument
2: Invalid parameter set in the method. For example, the specified channel name contains illegal characters. Please reset the parameter.
ErrNotReady
3: The SDK is not ready. Possible reasons include:
  • IRtcEngine initialization failed. Please reinitialize IRtcEngine.
  • The user has not joined a channel when calling the method. Please check the method call logic.
  • The user has not left the channel when calling rate or complain. Please check the method call logic.
  • The audio module is not enabled.
  • The assembly is incomplete.
ErrNotSupported
4: The current state of IRtcEngine does not support this operation. Possible reasons include:
  • When using built-in encryption, the encryption mode is incorrect, or loading the external encryption library failed. Please check if the encryption enumeration value is correct, or reload the external encryption library.
ErrRefused
5: This method call was rejected. Possible reasons include:
  • IRtcEngine initialization failed. Please reinitialize IRtcEngine.
  • The channel name was set to an empty string "" when joining the channel. Please reset the channel name.
  • In multi-channel scenarios, the specified channel name already exists when calling joinChannelEx to join the channel. Please reset the channel name.
ErrBufferTooSmall
6: The buffer size is insufficient to hold the returned data.
ErrNotInitialized
7: The method is called before IRtcEngine is initialized. Please ensure the IRtcEngine object is created and initialized before calling this method.
ErrInvalidState
8: The current state is invalid.
ErrNoPermission
9: No permission to operate. Please check whether the user has granted the app access to audio and video devices.
ErrTimedout
10: The method call timed out. Some method calls require the SDK to return a result. If the SDK takes too long (over 10 seconds) to process the event, this error occurs.
ErrJoinChannelRejected
17: Joining the channel was rejected. Possible reasons include:
  • The user is already in the channel. It is recommended to determine whether the user is in the channel through the onConnectionStateChanged callback. Do not call this method again to join the channel unless receiving the ConnectionStateDisconnected(1) state.
  • The user attempted to join a channel after calling startEchoTest for a call test without first calling stopEchoTest to end the current test. After starting a call test, you must call stopEchoTest to end the test before joining a channel.
ErrLeaveChannelRejected
18: Failed to leave the channel. Possible reasons include:
  • The user has already left the channel before calling leaveChannel. Just stop calling this method.
  • The user called leaveChannel to exit the channel without having joined it. No further action is needed in this case.
ErrAlreadyInUse
19: The resource is already in use and cannot be reused.
ErrAborted
20: The SDK aborted the request, possibly due to too many requests.
ErrInitNetEngine
21: Specific firewall settings on Windows caused IRtcEngine initialization to fail and crash.
ErrResourceLimited
22: The SDK failed to allocate resources, possibly due to excessive resource usage by the app or system resource exhaustion.
ErrInvalidAppId
101: Invalid App ID. Please use a valid App ID to rejoin the channel.
ErrInvalidChannelName
102: Invalid channel name. Possible reason is incorrect data type for the parameter. Please use a valid channel name to rejoin the channel.
ErrNoServerResources
103: Unable to acquire server resources in the current region. Try specifying another region when initializing IRtcEngine.
ErrTokenExpired
109: The current Token has expired and is no longer valid. Please request a new Token from your server and call renewToken to update it.
Note: Deprecated: This enumeration is deprecated. Use ConnectionChangedTokenExpired(9) in the onConnectionStateChanged callback instead.
ErrInvalidToken
Note: Deprecated: This enumeration is deprecated. Use ConnectionChangedInvalidToken(8) in the onConnectionStateChanged callback instead.
110: Invalid Token. Common reasons include:
  • App certificate is enabled in the console, but App ID + Token authentication is not used. When the App certificate is enabled, Token authentication must be used.
  • The uid field used when generating the Token does not match the uid used when the user joins the channel.
ErrConnectionInterrupted
111: Network connection interrupted. After the SDK establishes a connection with the server, it loses network connectivity for more than 4 seconds.
ErrConnectionLost
112: Network connection lost. The network is disconnected and the SDK fails to reconnect to the server within 10 seconds.
ErrNotInChannel
113: The user is not in a channel when calling the sendStreamMessage method.
ErrSizeTooLarge
114: The data length exceeds 1 KB when calling sendStreamMessage.
ErrBitrateLimit
115: The data sending rate exceeds the limit (6 KB/s) when calling sendStreamMessage.
ErrTooManyDataStreams
116: The number of data streams created exceeds the limit (5) when calling createDataStream.
ErrStreamMessageTimeout
117: Data stream sending timed out.
ErrSetClientRoleNotAuthorized
119: Failed to switch user role. Please try rejoining the channel.
ErrDecryptionFailed
120: Media stream decryption failed. Possibly due to an incorrect key used when the user joined the channel. Please check the key entered when joining the channel, or guide the user to try rejoining.
ErrInvalidUserId
121: Invalid user ID.
ErrDatastreamDecryptionFailed
122: Data stream decryption failed. Possibly due to an incorrect key used when the user joined the channel. Please check the key entered when joining the channel, or guide the user to try rejoining.
ErrClientIsBannedByServer
123: This user is banned by the server.
ErrEncryptedStreamNotAllowedPublish
130: The SDK does not support pushing encrypted streams to CDN.
ErrInvalidUserAccount
134: Invalid user account, possibly due to an invalid parameter.
ErrPcmsendFormat
200: Unsupported PCM format.
ErrPcmsendBufferoverflow
201: Buffer overflow due to PCM sending rate being too fast.
ErrCertRaw
1001: Failed to load the media engine.
ErrAdmGeneralError
1005: Audio device error (unspecified). Please check whether the audio device is occupied by another application, or try rejoining the channel.
ErrAdmInitPlayout
1008: Failed to initialize the playback device. Please check whether the playback device is occupied by another application, or try rejoining the channel.
ErrAdmStartPlayout
1009: Failed to start the playback device. Please check whether the playback device is functioning properly.
ErrAdmStopPlayout
1010: Failed to stop the playback device.
ErrAdmInitRecording
1011: Failed to initialize the recording device. Please check whether the recording device is functioning properly, or try rejoining the channel.
ErrAdmStartRecording
1012: Failed to start the recording device. Please check whether the recording device is functioning properly.
ErrAdmStopRecording
1013: Failed to stop the recording device.
ErrVdmCameraNotAuthorized
1501: No permission to use the camera. Please check whether camera permission is enabled.