ErrorCodeType

Error codes.

Error codes indicate that the SDK has 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 prompt the user that the camera cannot be used.

Enumerations

ErrOk
0: No error.
ErrFailed
1: A general error (no specific classification of the error cause). Please try calling the method again.
ErrInvalidArgument
2: An invalid parameter was 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:
  • IRtcEngine failed to initialize. Please reinitialize IRtcEngine.
  • The user has not joined the channel when calling the method. Please check the method call logic.
  • The user has not left the channel when calling the rate or complain method. 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:
  • When using built-in encryption, the encryption mode is incorrect, or loading the external encryption library failed. Please check whether the encryption enum value is correct or reload the external encryption library.
ErrRefused
5: This method call was rejected. Possible reasons:
  • IRtcEngine failed to initialize. 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 channel name already exists when calling joinChannelEx to join a channel. Please reset the channel name.
ErrBufferTooSmall
6: The buffer size is insufficient to store the returned data.
ErrNotInitialized
7: The method was called before IRtcEngine was initialized. Please ensure that 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 permission to use audio and video devices.
ErrTimedout
10: Method call timed out. Some method calls require a response from the SDK. If the SDK takes too long to process the event and does not return within 10 seconds, this error occurs.
ErrJoinChannelRejected
17: Joining the channel was rejected. Possible reasons:
  • The user is already in the channel. It is recommended to determine whether the user is in the channel via the onConnectionStateChanged callback. Do not call this method again to join the channel unless receiving the ConnectionStateDisconnected(1) state.
  • The user attempted to join the channel without calling stopEchoTest after initiating a call test with startEchoTest. After starting a call test, you must call stopEchoTest to end the current test before joining the channel.
ErrLeaveChannelRejected
18: Failed to leave the channel. Possible reasons:
  • The user has already left the channel before calling leaveChannel. Stop calling this method.
  • The user called leaveChannel before joining the channel. No additional 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: On Windows, specific firewall settings caused IRtcEngine to fail initialization and crash.
ErrResourceLimited
22: The SDK failed to allocate resources, possibly because the app is using too many resources or system resources are exhausted.
ErrInvalidAppId
101: Invalid App ID. Please use a valid App ID to rejoin the channel.
ErrInvalidChannelName
102: Invalid channel name. Possible reason is an incorrect data type for the parameter. Please use a valid channel name to rejoin the channel.
ErrNoServerResources
103: Unable to obtain 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 the Token.
Note: Deprecated: This enum is deprecated. Use the ConnectionChangedTokenExpired(9) in the onConnectionStateChanged callback instead.
ErrInvalidToken
Note: Deprecated: This enum is deprecated. Use the ConnectionChangedInvalidToken(8) in the onConnectionStateChanged callback instead.
110: Invalid Token. Common reasons:
  • App certificate is enabled in the console, but App ID + Token authentication is not used. When the project has App certificate enabled, Token authentication must be used.
  • The uid field used when generating the Token does not match the uid used when joining the channel.
ErrConnectionInterrupted
111: Network connection interrupted. After the SDK establishes a connection with the server, it loses the network connection 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 the channel when calling the sendStreamMessage method.
ErrSizeTooLarge
114: The data length exceeds 1 KB when calling sendStreamMessage.
ErrBitrateLimit
115: The data sending frequency exceeds the limit (6 KB/s) when calling sendStreamMessage.
ErrTooManyDataStreams
116: The number of data streams created exceeds the limit (5 streams) 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 the channel.
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 the channel.
ErrClientIsBannedByServer
123: The user is banned by the server.
ErrEncryptedStreamNotAllowedPublish
130: The SDK does not support pushing encrypted streams to the CDN.
ErrInvalidUserAccount
134: Invalid user account, possibly due to invalid parameters.
ErrPcmsendFormat
200: Unsupported PCM format.
ErrPcmsendBufferoverflow
201: Buffer overflow due to PCM sending rate being too fast.
ErrCertRaw
1001: Failed to load 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 playback device. Please check whether the playback device is occupied by another application or try rejoining the channel.
ErrAdmStartPlayout
1009: Failed to start playback device. Please check whether the playback device is functioning properly.
ErrAdmStopPlayout
1010: Failed to stop playback device.
ErrAdmInitRecording
1011: Failed to initialize recording device. Please check whether the recording device is functioning properly or try rejoining the channel.
ErrAdmStartRecording
1012: Failed to start recording device. Please check whether the recording device is functioning properly.
ErrAdmStopRecording
1013: Failed to stop recording device.
ErrVdmCameraNotAuthorized
1501: No permission to use the camera. Please check whether camera permission is enabled.