ErrorCode enum

Error codes occur when the SDK encounters an error that cannot be recovered automatically without any app intervention.

Inheritance

Constructors

ErrorCode()
const

Values

NoError → const ErrorCode

No error occurs.

Failed → const ErrorCode

A general error occurs (no specified reason).

InvalidArgument → const ErrorCode

An invalid parameter is used. For example, the specific channel name includes illegal characters.

NotReady → const ErrorCode

The SDK module is not ready. Possible solutions:

  • Check the audio device.
  • Check the completeness of the app.
  • Re-initialize the SDK.
NotSupported → const ErrorCode

The current state of the SDK does not support this function.

Refused → const ErrorCode

The request is rejected. This is for internal SDK use only, and is not returned to the app through any method or callback.

BufferTooSmall → const ErrorCode

The buffer size is not big enough to store the returned data.

NotInitialized → const ErrorCode

The SDK is not initialized before calling this method.

NoPermission → const ErrorCode

No permission exists. Check whether the user has granted access to the audio or video device.

TimedOut → const ErrorCode

An API method timeout occurs. Some API methods require the SDK to return the execution result, and this error occurs if the request takes too long (over 10 seconds) for the SDK to process.

Canceled → const ErrorCode

The request is canceled. This is for internal SDK use only, and is not returned to the app through any method or callback.

TooOften → const ErrorCode

The method is called too often. This is for internal SDK use only, and is not returned to the app through any method or callback.

BindSocket → const ErrorCode

The SDK fails to bind to the network socket. This is for internal SDK use only, and is not returned to the app through any method or callback.

NetDown → const ErrorCode

The network is unavailable. This is for internal SDK use only, and is not returned to the app through any method or callback.

NoBufs → const ErrorCode

No network buffers are available. This is for internal SDK use only, and is not returned to the app through any method or callback.

JoinChannelRejected → const ErrorCode

The request to join the channel is rejected. Possible reasons are:

  • The user is already in the channel, and still calls the API method to join the channel, for example, RtcEngine.joinChannel.
  • The user tries joining the channel during the echo test. Please join the channel after the echo test ends.
LeaveChannelRejected → const ErrorCode

The request to leave the channel is rejected. Possible reasons are:

  • The user left the channel and still calls the API method to leave the channel, for example, RtcEngine.leaveChannel.
  • The user has not joined the channel and calls the API method to leave the channel.
AlreadyInUse → const ErrorCode

The resources are occupied and cannot be used.

Abort → const ErrorCode

The SDK gave up the request due to too many requests.

InitNetEngine → const ErrorCode

In Windows, specific firewall settings cause the SDK to fail to initialize and crash.

ResourceLimited → const ErrorCode

The app uses too much of the system resources and the SDK fails to allocate the resources.

InvalidAppId → const ErrorCode

The specified App ID is invalid. Please try to rejoin the channel with a valid App ID.

InvalidChannelId → const ErrorCode

The specified channel name is invalid. Please try to rejoin the channel with a valid channel name.

NoServerResources → const ErrorCode

103: Fails to get server resources in the specified region. Please try to specify another region.

TokenExpired → const ErrorCode

The token expired. Agora recommends that you use ConnectionChangedReason.TokenExpired in the reason parameter of RtcEngineEventHandler.connectionStateChanged instead.

Possible reasons are:

  • Authorized Timestamp expired: The timestamp is represented by the number of seconds elapsed since 1/1/1970. The user can use the token to access the Agora service within five minutes after the token is generated. If the user does not access the Agora service after five minutes, this token is no longer valid.
  • Call Expiration Timestamp expired: The timestamp is the exact time when a user can no longer use the Agora service (for example, when a user is forced to leave an ongoing call). When a value is set for the Call Expiration Timestamp, it does not mean that the token will expire, but that the user will be banned from the channel.
InvalidToken → const ErrorCode

The token is invalid. Agora recommends that you use ConnectionChangedReason.InvalidToken in the reason parameter of RtcEngineEventHandler.connectionStateChanged instead.

Possible reasons are:

  • The App Certificate for the project is enabled in Console, but the user is using the App ID. Once the App Certificate is enabled, the user must use a token.
  • The uid is mandatory, and users must set the same uid as the one set in the RtcEngine.joinChannel method.
ConnectionInterrupted → const ErrorCode

The Internet connection is interrupted. This applies to the Agora Web SDK only.

ConnectionLost → const ErrorCode

The Internet connection is lost. This applies to the Agora Web SDK only.

NotInChannel → const ErrorCode

The user is not in the channel when calling the RtcEngine.sendStreamMessage or RtcEngine.getUserInfoByUserAccount method.

SizeTooLarge → const ErrorCode

The size of the sent data is over 1024 bytes when the user calls the RtcEngine.sendStreamMessage method.

BitrateLimit → const ErrorCode

The bitrate of the sent data exceeds the limit of 6 Kbps when the user calls the RtcEngine.sendStreamMessage method.

TooManyDataStreams → const ErrorCode

Too many data streams (over five streams) are created when the user calls the RtcEngine.createDataStream method.

DecryptionFailed → const ErrorCode

Decryption fails. The user may have used a different encryption password to join the channel. Check your settings or try rejoining the channel.

ClientIsBannedByServer → const ErrorCode

The client is banned by the server.

WatermarkParam → const ErrorCode

Incorrect watermark file parameter.

WatermarkPath → const ErrorCode

Incorrect watermark file path.

WatermarkPng → const ErrorCode

Incorrect watermark file format.

WatermarkInfo → const ErrorCode

Incorrect watermark file information.

WatermarkAGRB → const ErrorCode

Incorrect watermark file data format.

WatermarkRead → const ErrorCode

An error occurs in reading the watermark file.

EncryptedStreamNotAllowedPublish → const ErrorCode

The encrypted stream is not allowed to publish.

InvalidUserAccount → const ErrorCode

The user account is invalid.

PublishStreamCDNError → const ErrorCode

CDN related errors. Remove the original URL address and add a new one by calling the RtcEngine.removePublishStreamUrl and RtcEngine.addPublishStreamUrl methods.

PublishStreamNumReachLimit → const ErrorCode

The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones.

PublishStreamNotAuthorized → const ErrorCode

The host manipulates other hosts' URLs. Check your app logic.

PublishStreamInternalServerError → const ErrorCode

An error occurs in Agora’s streaming server. Call the addPublishStreamUrl method to publish the stream again.

See RtcEngine.addPublishStreamUrl

PublishStreamNotFound → const ErrorCode

The server fails to find the stream.

PublishStreamFormatNotSuppported → const ErrorCode

The format of the RTMP stream URL is not supported. Check whether the URL format is correct.

ModuleNotFound → const ErrorCode

The extension library is not integrated, such as the library for enabling deep-learning noise reduction.

AlreadyInRecording → const ErrorCode

The client is already recording audio. To start a new recording, call RtcEngine.stopAudioRecording to stop the current recording first, and then call RtcEngine.startAudioRecording.

LoadMediaEngine → const ErrorCode

Fails to load the media engine.

StartCall → const ErrorCode

Fails to start the call after enabling the media engine.

StartCamera → const ErrorCode

Fails to start the camera. Agora recommends that you use LocalVideoStreamError.CaptureFailure in the error parameter of RtcEngineEventHandler.localVideoStateChanged instead.

StartVideoRender → const ErrorCode

Fails to start the video rendering module.

AdmGeneralError → const ErrorCode

Audio Device Module: A general error occurs in the Audio Device Module (the reason is not classified specifically). Check if the audio device is used by another app, or try rejoining the channel.

AdmJavaResource → const ErrorCode

Audio Device Module: An error occurs in using the Java resources.

AdmSampleRate → const ErrorCode

Audio Device Module: An error occurs in setting the sampling frequency.

AdmInitPlayout → const ErrorCode

Audio Device Module: An error occurs in initializing the playback device.

AdmStartPlayout → const ErrorCode

Audio Device Module: An error occurs in starting the playback device.

AdmStopPlayout → const ErrorCode

Audio Device Module: An error occurs in stopping the playback device.

AdmInitRecording → const ErrorCode

Audio Device Module: An error occurs in initializing the recording device.

AdmStartRecording → const ErrorCode

Audio Device Module: An error occurs in starting the recording device.

AdmStopRecording → const ErrorCode

Audio Device Module: An error occurs in stopping the recording device.

AdmRuntimePlayoutError → const ErrorCode

Audio Device Module: A playback error occurs. Check your playback device, or try rejoining the channel.

AdmRuntimeRecordingError → const ErrorCode

Audio Device Module: A recording error occurs.

AdmRecordAudioFailed → const ErrorCode

Audio Device Module: Fails to record.

AdmPlayAbnormalFrequency → const ErrorCode

Audio Device Module: Abnormal audio playback frequency.

AdmRecordAbnormalFrequency → const ErrorCode

Audio Device Module: Abnormal audio recording frequency.

AdmInitLoopback → const ErrorCode

Audio Device Module: An error occurs in initializing the loopback device.

AdmStartLoopback → const ErrorCode

Audio Device Module: An error occurs in starting the loopback device.

AdmNoPermission → const ErrorCode

Audio Device Module: An error occurs in no recording Permission.

AudioBtScoFailed → const ErrorCode

Audio Routing: Fails to route the audio to the connected Bluetooth device. The default route is used.

AdmNoRecordingDevice → const ErrorCode

Audio Device Module: No recording device exists.

AdmNoPlayoutDevice → const ErrorCode

No playback device exists.

VdmCameraNotAuthorized → const ErrorCode

Video Device Module: The camera is unauthorized.

VcmUnknownError → const ErrorCode

Video Device Module: An unknown error occurs.

VcmEncoderInitError → const ErrorCode

Video Device Module: An error occurs in initializing the video encoder.

VcmEncoderEncodeError → const ErrorCode

Video Device Module: An error occurs in video encoding.

VcmEncoderSetError → const ErrorCode

Video Device Module: An error occurs in setting the video encoder.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<ErrorCode>
A constant List of the values in this enum, in order of their declaration.