ios_to_code static method

ErrorCode ios_to_code(
  1. ByteRTCErrorCode value
)

Implementation

static ErrorCode ios_to_code($p_i.ByteRTCErrorCode value) {
  var $m = {
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeInvalidToken:
        ErrorCode.invalidToken,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeJoinRoom: ErrorCode.joinRoom,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeNoPublishPermission:
        ErrorCode.noPublishPermission,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeNoSubscribePermission:
        ErrorCode.noSubscribePermission,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeDuplicateLogin:
        ErrorCode.duplicateLogin,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeKickedOut: ErrorCode.kickedOut,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeRoomIdIllegal:
        ErrorCode.roomIdIllegal,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeTokenExpired:
        ErrorCode.tokenExpired,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeUpdateTokenWithInvalidToken:
        ErrorCode.updateTokenWithInvalidToken,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeRoomDismiss: ErrorCode.roomDismiss,
    $p_i.ByteRTCErrorCode.ByteRTCJoinRoomWithoutLicenseAuthenticateSDK:
        ErrorCode.joinRoomWithoutLicenseAuthenticateSDK,
    $p_i.ByteRTCErrorCode.ByteRTCRoomAlreadyExist: ErrorCode.roomAlreadyExist,
    $p_i.ByteRTCErrorCode.ByteRTCUserIDDifferent: ErrorCode.userIdDifferent,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeJoinRoomServerLicenseExpired:
        ErrorCode.joinRoomServerLicenseExpired,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeJoinRoomExceedsTheUpperLimit:
        ErrorCode.joinRoomExceedsTheUpperLimit,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeJoinRoomLicenseParameterError:
        ErrorCode.joinRoomLicenseParameterError,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeJoinRoomLicenseFilePathError:
        ErrorCode.joinRoomLicenseFilePathError,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeJoinRoomLicenseIllegal:
        ErrorCode.joinRoomLicenseIllegal,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeJoinRoomLicenseExpired:
        ErrorCode.joinRoomLicenseExpired,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeJoinRoomLicenseInformationNotMatch:
        ErrorCode.joinRoomLicenseInformationNotMatch,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeJoinRoomLicenseNotMatchWithCache:
        ErrorCode.joinRoomLicenseNotMatchWithCache,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeJoinRoomRoomForbidden:
        ErrorCode.joinRoomRoomForbidden,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeJoinRoomUserForbidden:
        ErrorCode.joinRoomUserForbidden,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeOverStreamPublishLimit:
        ErrorCode.overStreamPublishLimit,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeAbnormalServerStatus:
        ErrorCode.abnormalServerStatus,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeMultiRoomUnpublishFailed:
        ErrorCode.ERROR_CODE_MULTI_ROOM_UNPUBLISH_FAILED,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeWrongAreaCode:
        ErrorCode.ERROR_CODE_WRONG_AREA_CODE,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeOverStreamSubscribeLimit:
        ErrorCode.overStreamSubscribeLimit,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodInvalidAudioSyncUidRepeated:
        ErrorCode.invalidAudioSyncUidRepeated,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeOverVideoPublishLimit:
        ErrorCode.overVideoPublishLimit,
    $p_i.ByteRTCErrorCode.ByteRTCErrorCodeDeadLockNotify:
        ErrorCode.ByteRTCErrorCodeDeadLockNotify,
  };
  if (!($m.containsKey(value))) {
    throw Exception("invalid value:" + value.toString());
  }
  // @ts-ignore
  return $m[value] as ErrorCode;
}