Skip to main content
Error codes defined by the Android SRTC SDK fall into two categories:
  • StatusCode: Android error codes mapped from local librtc status codes.
  • cn.seastart.rtc.error: 102xxx error codes with unified semantics produced by the Android SDK itself.
Callback error codes use Int. Local librtc errors are mapped to Android 102xxx codes; backend business codes retain their original values. HTTP library and media streaming vendor errors may still have other values, so handle unknown error codes as a fallback.

Error message message

Starting with 2.0.36, RTCClientEvent.onJoinFailed(...) and RTCResultListener.onFail(...) include a message: String parameter. When a backend error has a message available, message may contain the text returned by the backend. Use RTCEngine.setLanguage(...) to set the request language; the actual message depends on the backend response. With RtcLanguage.SYSTEM, requests follow the system language. SDK-produced errors and local librtc errors have an empty message; diagnostic details are only used in logs. Backend error codes and messages pass through unchanged based on their source, not their numeric range. A non-null String callback converts a null backend message to an empty string without generating text. Your app can map codes to localized text when no message is available. Non-2xx HTTP responses retain their original status code and status message. Without an HTTP status code, request timeouts return 102007, ordinary network failures return 102006, and parsing failures, a missing code, or an empty response return 102011, all with empty messages. Request cancellation still uses the cancellation callback. The message parameter of RTCEngineEvent.onError(...) is nullable. See RTCEngineEvent.

librtc status codes StatusCode

The table compares public enum values in 2.0.35 and 2.0.36. The new values apply starting with 2.0.36. If your app uses hard-coded old values, update them; prefer referencing enum constants. NotInitialized and MediaNotInitialized share 102024; NotFound and RtcErrorCode.USER_NOT_FOUND share 102204.

Unified error codes in 2.0.38: RtcErrorCode

Starting with 2.0.38, the seven domain-specific error code objects are replaced by cn.seastart.rtc.error.RtcErrorCode. All 40 constants are listed below. Update constant references and localized mappings when upgrading.

Migrating from 2.0.37

The permission meaning of the old 102001 moves to 102042; the new 102001 means not in the channel. Do not reuse hard-coded messages for the old value. All new constants below belong to RtcErrorCode.

Error catalog lookup

RtcErrorCatalog.find(code) looks up SDK-defined error descriptions by numeric value alone; it cannot identify an error’s source. It returns null for unknown codes. StatusCode.NotFound and the SDK’s USER_NOT_FOUND both have value 102204, so looking up that value returns USER_NOT_FOUND.
RtcErrorDescriptor fields: RtcErrorCatalog.all returns descriptors for all errors produced by the current SDK. RtcErrorModule domains and their reserved ranges: Call RtcErrorModule.owns(code) to check whether an SDK-produced error falls within that domain’s reserved range; this is not the same as checking whether the error is formally defined in RtcErrorCatalog.

Callback handling recommendations

  • RTCClientEvent.onJoinFailed(channel, statusCode, message): handle join failures.
  • RTCResultListener.onFail(code, message): handle failures of specific asynchronous operations.
  • RTCEngineEvent.onError(channelId, errorCode, message): handle blocking errors from Engine operations, and global errors.
  • RTCClientEvent.onDisconnected(channel, leaveReason, statusCode, message): handle unrecoverable channel disconnects.
When logging errors, keep the channel ID, the raw numeric value, and the runtime message together. Don’t rely only on enums or RtcErrorCatalog; otherwise new upstream errors the SDK doesn’t recognize yet will be lost.