io.agora.rtc

## Enum Constants.ErrorCodeType

- java.lang.Object
- - java.lang.Enum<Constants.ErrorCodeType>
  - - io.agora.rtc.Constants.ErrorCodeType

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Constants.ErrorCodeType>
  Enclosing class:
    Constants

      public static enum Constants.ErrorCodeType
      extends java.lang.Enum<Constants.ErrorCodeType>

  The error codes.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `ERR_ABORTED` 20: The SDK gives up the request due to too many requests.
    `ERR_ADM_GENERAL_ERROR` 1005: Audio device module: A general error occurs in the Audio Device Module (no specified reason).
    `ERR_ADM_INIT_PLAYOUT` 1008: Audio Device Module: An error occurs in initializing the playback device.
    `ERR_ADM_INIT_RECORDING` 1011: Audio Device Module: An error occurs in initializing the recording device.
    `ERR_ADM_START_PLAYOUT` 1009: Audio Device Module: An error occurs in starting the playback device.
    `ERR_ADM_START_RECORDING` 1012: Audio Device Module: An error occurs in starting the recording device.
    `ERR_ADM_STOP_PLAYOUT` 1010: Audio Device Module: An error occurs in stopping the playback device.
    `ERR_ADM_STOP_RECORDING` 1013: Audio Device Module: An error occurs in stopping the recording device.
    `ERR_ALREADY_IN_USE` 19: The resources have been occupied and cannot be reused.
    `ERR_BIND_SOCKET` 13: The SDK fails to bind to the network socket.
    `ERR_BITRATE_LIMIT` 115: The bitrate of the sent data exceeds the limit of 6 Kbps when the user calls the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage()".
    `ERR_BUFFER_TOO_SMALL` 6: The buffer size is not big enough to store the returned data.
    `ERR_CANCELED` 11: The request is cancelled.
    `ERR_CERT_BUF`
    `ERR_CERT_CREDENTIAL`
    `ERR_CERT_CUSTOM`
    `ERR_CERT_DUEDATE`
    `ERR_CERT_FAIL`
    `ERR_CERT_JSON_INVAL`
    `ERR_CERT_JSON_NOMEM`
    `ERR_CERT_JSON_PART`
    `ERR_CERT_NULL`
    `ERR_CERT_RAW`
    `ERR_CERT_REQUEST`
    `ERR_CERT_SIGN`
    `ERR_CLIENT_IS_BANNED_BY_SERVER` 123: The app is banned by the server.
    `ERR_CONNECTION_INTERRUPTED` 111: The internet connection is interrupted.
    `ERR_CONNECTION_LOST` 112: The internet connection is lost.
    `ERR_DATASTREAM_DECRYPTION_FAILED` 122: DataStream decryption fails.
    `ERR_DECRYPTION_FAILED` 120: MediaStream decryption fails.
    `ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH` 130: Encryption is enabled when the user calls the \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl()" method (CDN live streaming does not support encrypted streams).
    `ERR_FAILED` 1: A general error occurs (no specified reason).
    `ERR_INIT_NET_ENGINE` 21: On Windows, specific firewall settings can cause the SDK to fail to initialize and crash.
    `ERR_INVALID_APP_ID` 101: The App ID is invalid, usually because the data format of the App ID is incorrect.
    `ERR_INVALID_ARGUMENT` 2: The argument is invalid.
    `ERR_INVALID_CHANNEL_NAME` 102: The specified channel name is invalid.
    `ERR_INVALID_STATE` 8: The state is invalid.
    `ERR_INVALID_TOKEN` 110: The token is invalid, usually for one of the following reasons: - Did not provide a token when joining a channel in a situation where the project has enabled the App Certificate.
    `ERR_INVALID_USER_ACCOUNT` 134: The user account is invalid, usually because the data format of the user account is incorrect.
    `ERR_INVALID_USER_ID` 121: The user ID is invalid.
    `ERR_JOIN_CHANNEL_REJECTED` 17: The request to join the channel is rejected.
    `ERR_LEAVE_CHANNEL_REJECTED` 18: The request to leave the channel is rejected.
    `ERR_LICENSE_CREDENTIAL_INVALID` 131: License credential is invalid
    `ERR_LOAD_MEDIA_ENGINE` 1001: Fails to load the media engine.
    `ERR_LOGIN_ALREADY_LOGIN`
    `ERR_MODULE_NOT_FOUND` 157: The necessary dynamical library is not integrated.
    `ERR_NET_DOWN` 14: The network is unavailable.
    `ERR_NO_PERMISSION` 9: No permission.
    `ERR_NO_SERVER_RESOURCES` 103: Fails to get server resources in the specified region.
    `ERR_NOT_IN_CHANNEL` 113: The user is not in the channel when calling the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage()" method.
    `ERR_NOT_INITIALIZED` 7: The SDK is not initialized before calling this method.
    `ERR_NOT_READY` 3: The SDK module is not ready.
    `ERR_NOT_SUPPORTED` 4: The SDK does not support this function.
    `ERR_OK` 0: No error occurs.
    `ERR_PCMSEND_BUFFEROVERFLOW`
    `ERR_PCMSEND_FORMAT`
    `ERR_REFUSED` 5: The request is rejected.
    `ERR_RESOURCE_LIMITED` 22: The app uses too much of the system resource and the SDK fails to allocate any resource.
    `ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED` 119: Switching the user role fails.
    `ERR_SIZE_TOO_LARGE` 114: The data size is over 1024 bytes when the user calls the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage()" method.
    `ERR_STREAM_MESSAGE_TIMEOUT` 117: A timeout occurs for the data stream transmission.
    `ERR_TIMEDOUT` 10: An API timeout occurs.
    `ERR_TOKEN_EXPIRED` 109: The token has expired, usually for the following reasons: - Timeout for token authorization: Once a token is generated, you must use it to access the Agora service within 24 hours.
    `ERR_TOO_MANY_DATA_STREAMS` 116: Too many data streams (over 5) are created when the user calls the \ref agora::rtc::IRtcEngine::createDataStream "createDataStream()" method.
    `ERR_TOO_OFTEN` 12: The method is called too often.
    `ERR_VDM_CAMERA_NOT_AUTHORIZED` 1501: Video Device Module: The camera is not authorized.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `value`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Constants.ErrorCodeType` | `fromInt(int value)`
    `int` | `getValue()`
    `static Constants.ErrorCodeType` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static Constants.ErrorCodeType[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### ERR_OK

          public static final Constants.ErrorCodeType ERR_OK

      0: No error occurs.

    - #### ERR_FAILED

          public static final Constants.ErrorCodeType ERR_FAILED

      1: A general error occurs (no specified reason).

    - #### ERR_INVALID_ARGUMENT

          public static final Constants.ErrorCodeType ERR_INVALID_ARGUMENT

      2: The argument is invalid. For example, the specific channel name includes illegal characters.

    - #### ERR_NOT_READY

          public static final Constants.ErrorCodeType ERR_NOT_READY

      3: The SDK module is not ready. Choose one of the following solutions: - Check the audio device. - Check the completeness of the app. - Reinitialize the RTC engine.

    - #### ERR_NOT_SUPPORTED

          public static final Constants.ErrorCodeType ERR_NOT_SUPPORTED

      4: The SDK does not support this function.

    - #### ERR_REFUSED

          public static final Constants.ErrorCodeType ERR_REFUSED

      5: The request is rejected.

    - #### ERR_BUFFER_TOO_SMALL

          public static final Constants.ErrorCodeType ERR_BUFFER_TOO_SMALL

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

    - #### ERR_NOT_INITIALIZED

          public static final Constants.ErrorCodeType ERR_NOT_INITIALIZED

      7: The SDK is not initialized before calling this method.

    - #### ERR_INVALID_STATE

          public static final Constants.ErrorCodeType ERR_INVALID_STATE

      8: The state is invalid.

    - #### ERR_NO_PERMISSION

          public static final Constants.ErrorCodeType ERR_NO_PERMISSION

      9: No permission. This is for internal use only, and does not return to the app through any method or callback.

    - #### ERR_TIMEDOUT

          public static final Constants.ErrorCodeType ERR_TIMEDOUT

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

    - #### ERR_CANCELED

          public static final Constants.ErrorCodeType ERR_CANCELED

      11: The request is cancelled. This is for internal use only, and does not return to the app through any method or callback.

    - #### ERR_TOO_OFTEN

          public static final Constants.ErrorCodeType ERR_TOO_OFTEN

      12: The method is called too often. This is for internal use only, and does not return to the app through any method or callback.

    - #### ERR_BIND_SOCKET

          public static final Constants.ErrorCodeType ERR_BIND_SOCKET

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

    - #### ERR_NET_DOWN

          public static final Constants.ErrorCodeType ERR_NET_DOWN

      14: The network is unavailable. This is for internal use only, and does not return to the app through any method or callback.

    - #### ERR_JOIN_CHANNEL_REJECTED

          public static final Constants.ErrorCodeType ERR_JOIN_CHANNEL_REJECTED

      17: The request to join the channel is rejected. This error usually occurs when the user is already in the channel, and still calls the method to join the channel, for example, \ref agora::rtc::IRtcEngine::joinChannel "joinChannel()".

    - #### ERR_LEAVE_CHANNEL_REJECTED

          public static final Constants.ErrorCodeType ERR_LEAVE_CHANNEL_REJECTED

      18: The request to leave the channel is rejected. This error usually occurs when the user has already left the channel, and still calls the method to leave the channel, for example, \ref agora::rtc::IRtcEngine::leaveChannel "leaveChannel".

    - #### ERR_ALREADY_IN_USE

          public static final Constants.ErrorCodeType ERR_ALREADY_IN_USE

      19: The resources have been occupied and cannot be reused.

    - #### ERR_ABORTED

          public static final Constants.ErrorCodeType ERR_ABORTED

      20: The SDK gives up the request due to too many requests. This is for internal use only, and does not return to the app through any method or callback.

    - #### ERR_INIT_NET_ENGINE

          public static final Constants.ErrorCodeType ERR_INIT_NET_ENGINE

      21: On Windows, specific firewall settings can cause the SDK to fail to initialize and crash.

    - #### ERR_RESOURCE_LIMITED

          public static final Constants.ErrorCodeType ERR_RESOURCE_LIMITED

      22: The app uses too much of the system resource and the SDK fails to allocate any resource.

    - #### ERR_INVALID_APP_ID

          public static final Constants.ErrorCodeType ERR_INVALID_APP_ID

      101: The App ID is invalid, usually because the data format of the App ID is incorrect. Solution: Check the data format of your App ID. Ensure that you use the correct App ID to initialize the Agora service.

    - #### ERR_INVALID_CHANNEL_NAME

          public static final Constants.ErrorCodeType ERR_INVALID_CHANNEL_NAME

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

    - #### ERR_NO_SERVER_RESOURCES

          public static final Constants.ErrorCodeType ERR_NO_SERVER_RESOURCES

      103: Fails to get server resources in the specified region. Please try to specify another region when calling \ref agora::rtc::IRtcEngine::initialize "initialize".

    - #### ERR_TOKEN_EXPIRED

          public static final Constants.ErrorCodeType ERR_TOKEN_EXPIRED

      109: The token has expired, usually for the following reasons: - Timeout for token authorization: Once a token is generated, you must use it to access the Agora service within 24 hours. Otherwise, the token times out and you can no longer use it. - The token privilege expires: To generate a token, you need to set a timestamp for the token privilege to expire. For example, If you set it as seven days, the token expires seven days after its usage. In that case, you can no longer access the Agora service. The users cannot make calls, or are kicked out of the channel. Solution: Regardless of whether token authorization times out or the token privilege expires, you need to generate a new token on your server, and try to join the channel.

    - #### ERR_INVALID_TOKEN

          public static final Constants.ErrorCodeType ERR_INVALID_TOKEN

      110: The token is invalid, usually for one of the following reasons: - Did not provide a token when joining a channel in a situation where the project has enabled the App Certificate. - Tried to join a channel with a token in a situation where the project has not enabled the App Certificate. - The App ID, user ID and channel name that you use to generate the token on the server do not match those that you use when joining a channel. Solution: - Before joining a channel, check whether your project has enabled the App certificate. If yes, you must provide a token when joining a channel; if no, join a channel without a token. - When using a token to join a channel, ensure that the App ID, user ID, and channel name that you use to generate the token is the same as the App ID that you use to initialize the Agora service, and the user ID and channel name that you use to join the channel.

    - #### ERR_CONNECTION_INTERRUPTED

          public static final Constants.ErrorCodeType ERR_CONNECTION_INTERRUPTED

      111: The internet connection is interrupted. This applies to the Agora Web SDK only.

    - #### ERR_CONNECTION_LOST

          public static final Constants.ErrorCodeType ERR_CONNECTION_LOST

      112: The internet connection is lost. This applies to the Agora Web SDK only.

    - #### ERR_NOT_IN_CHANNEL

          public static final Constants.ErrorCodeType ERR_NOT_IN_CHANNEL

      113: The user is not in the channel when calling the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage()" method.

    - #### ERR_SIZE_TOO_LARGE

          public static final Constants.ErrorCodeType ERR_SIZE_TOO_LARGE

      114: The data size is over 1024 bytes when the user calls the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage()" method.

    - #### ERR_BITRATE_LIMIT

          public static final Constants.ErrorCodeType ERR_BITRATE_LIMIT

      115: The bitrate of the sent data exceeds the limit of 6 Kbps when the user calls the \ref agora::rtc::IRtcEngine::sendStreamMessage "sendStreamMessage()".

    - #### ERR_TOO_MANY_DATA_STREAMS

          public static final Constants.ErrorCodeType ERR_TOO_MANY_DATA_STREAMS

      116: Too many data streams (over 5) are created when the user calls the \ref agora::rtc::IRtcEngine::createDataStream "createDataStream()" method.

    - #### ERR_STREAM_MESSAGE_TIMEOUT

          public static final Constants.ErrorCodeType ERR_STREAM_MESSAGE_TIMEOUT

      117: A timeout occurs for the data stream transmission.

    - #### ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED

          public static final Constants.ErrorCodeType ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED

      119: Switching the user role fails. Please try to rejoin the channel.

    - #### ERR_DECRYPTION_FAILED

          public static final Constants.ErrorCodeType ERR_DECRYPTION_FAILED

      120: MediaStream decryption fails. The user may have tried to join the channel with a wrong password. Check your settings or try rejoining the channel.

    - #### ERR_INVALID_USER_ID

          public static final Constants.ErrorCodeType ERR_INVALID_USER_ID

      121: The user ID is invalid.

    - #### ERR_DATASTREAM_DECRYPTION_FAILED

          public static final Constants.ErrorCodeType ERR_DATASTREAM_DECRYPTION_FAILED

      122: DataStream decryption fails. The peer may have tried to join the channel with a wrong password, or did't enable datastream encryption

    - #### ERR_CLIENT_IS_BANNED_BY_SERVER

          public static final Constants.ErrorCodeType ERR_CLIENT_IS_BANNED_BY_SERVER

      123: The app is banned by the server.

    - #### ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH

          public static final Constants.ErrorCodeType ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH

      130: Encryption is enabled when the user calls the \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl()" method (CDN live streaming does not support encrypted streams).

    - #### ERR_LICENSE_CREDENTIAL_INVALID

          public static final Constants.ErrorCodeType ERR_LICENSE_CREDENTIAL_INVALID

      131: License credential is invalid

    - #### ERR_INVALID_USER_ACCOUNT

          public static final Constants.ErrorCodeType ERR_INVALID_USER_ACCOUNT

      134: The user account is invalid, usually because the data format of the user account is incorrect.

    - #### ERR_MODULE_NOT_FOUND

          public static final Constants.ErrorCodeType ERR_MODULE_NOT_FOUND

      157: The necessary dynamical library is not integrated. For example, if you call the \ref agora::rtc::IRtcEngine::enableDeepLearningDenoise "enableDeepLearningDenoise" but do not integrate the dynamical library for the deep-learning noise reduction into your project, the SDK reports this error code.

    - #### ERR_CERT_RAW

          public static final Constants.ErrorCodeType ERR_CERT_RAW

    - #### ERR_CERT_JSON_PART

          public static final Constants.ErrorCodeType ERR_CERT_JSON_PART

    - #### ERR_CERT_JSON_INVAL

          public static final Constants.ErrorCodeType ERR_CERT_JSON_INVAL

    - #### ERR_CERT_JSON_NOMEM

          public static final Constants.ErrorCodeType ERR_CERT_JSON_NOMEM

    - #### ERR_CERT_CUSTOM

          public static final Constants.ErrorCodeType ERR_CERT_CUSTOM

    - #### ERR_CERT_CREDENTIAL

          public static final Constants.ErrorCodeType ERR_CERT_CREDENTIAL

    - #### ERR_CERT_SIGN

          public static final Constants.ErrorCodeType ERR_CERT_SIGN

    - #### ERR_CERT_FAIL

          public static final Constants.ErrorCodeType ERR_CERT_FAIL

    - #### ERR_CERT_BUF

          public static final Constants.ErrorCodeType ERR_CERT_BUF

    - #### ERR_CERT_NULL

          public static final Constants.ErrorCodeType ERR_CERT_NULL

    - #### ERR_CERT_DUEDATE

          public static final Constants.ErrorCodeType ERR_CERT_DUEDATE

    - #### ERR_CERT_REQUEST

          public static final Constants.ErrorCodeType ERR_CERT_REQUEST

    - #### ERR_PCMSEND_FORMAT

          public static final Constants.ErrorCodeType ERR_PCMSEND_FORMAT

    - #### ERR_PCMSEND_BUFFEROVERFLOW

          public static final Constants.ErrorCodeType ERR_PCMSEND_BUFFEROVERFLOW

    - #### ERR_LOGIN_ALREADY_LOGIN

          public static final Constants.ErrorCodeType ERR_LOGIN_ALREADY_LOGIN

    - #### ERR_LOAD_MEDIA_ENGINE

          public static final Constants.ErrorCodeType ERR_LOAD_MEDIA_ENGINE

      1001: Fails to load the media engine.

    - #### ERR_ADM_GENERAL_ERROR

          public static final Constants.ErrorCodeType ERR_ADM_GENERAL_ERROR

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

    - #### ERR_ADM_INIT_PLAYOUT

          public static final Constants.ErrorCodeType ERR_ADM_INIT_PLAYOUT

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

    - #### ERR_ADM_START_PLAYOUT

          public static final Constants.ErrorCodeType ERR_ADM_START_PLAYOUT

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

    - #### ERR_ADM_STOP_PLAYOUT

          public static final Constants.ErrorCodeType ERR_ADM_STOP_PLAYOUT

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

    - #### ERR_ADM_INIT_RECORDING

          public static final Constants.ErrorCodeType ERR_ADM_INIT_RECORDING

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

    - #### ERR_ADM_START_RECORDING

          public static final Constants.ErrorCodeType ERR_ADM_START_RECORDING

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

    - #### ERR_ADM_STOP_RECORDING

          public static final Constants.ErrorCodeType ERR_ADM_STOP_RECORDING

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

    - #### ERR_VDM_CAMERA_NOT_AUTHORIZED

          public static final Constants.ErrorCodeType ERR_VDM_CAMERA_NOT_AUTHORIZED

      1501: Video Device Module: The camera is not authorized.

  - ### Field Detail

    - #### value

          private final int value

  - ### Method Detail

    - #### values

          public static Constants.ErrorCodeType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (Constants.ErrorCodeType c : Constants.ErrorCodeType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static Constants.ErrorCodeType valueOf(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null

    - #### getValue

          public int getValue()

    - #### fromInt

          public static Constants.ErrorCodeType fromInt(int value)