Skip to main content
The error type the SDK throws is SMeetingError, a semantic Swift enum that also provides integer error codes unified across platforms.
  • Use switch to branch on meaning
  • Use error.code to get the full error code and error.baseCode to get the low 3-digit semantic code, handy for logs, support tickets, and cross-platform comparison
  • Use error.message to get the English description; error.localizedDescription outputs "<code>: <message>"
  • Errors from the RTC layer (capture, permissions, publishing and subscribing) are passed through unchanged as SRTCError; see SRTC error codes
Since 1.4.0, error codes are adjusted according to the cross-platform unified table, and error messages are in English. For the mapping between the old codes (1.3.10 and earlier) and the new ones, see the Changelog.

Error list

message is an English description for developers and logs. For messages shown to end users, map code / baseCode yourself—don’t show message directly.

Server codes that need special handling

The following two server codes are thrown by enterRoom (apiError) and are not failures. The SDK provides constants for them (since 1.14.0); check with error.code == SMeetingError.xxxCode: Call exitWaitingRoom when leaving either kind of waiting page; if the meeting ends or is cancelled while waiting, imWaitingMeetingEnd arrives. See Waiting room.

Error code format

SMeetingError.code returns the full error code:
  • Client errors: platform prefix + a 3-digit low code. The iOS prefix is 203 and the macOS prefix is 205
  • Errors passed through from the server (apiError with a server code of 1000 or greater) are kept as-is, without a prefix
  • HTTP status codes are never folded into the error code: non-200 HTTP responses are always 007 (httpError), with the status in httpStatus
baseCode is the low 3-digit semantic code and means the same as on Web, Android, HarmonyOS, and other platforms; for server codes, baseCode returns the code itself. Examples: This lets you tell at a glance whether an error was “stopped by the client itself” or “returned by the server.” SMeetingError implements CustomNSError: once bridged to NSError, domain = "cn.seastart.smeeting" and code is the full code. Integrations that go through NSError, such as ObjC, uni-app, or Flutter, can check the code directly.

Error language

meeting.language (such as "en" or "zh-CN"; nil follows the system language) is the same process-wide setting as the SRTC layer’s language. Requests from both the meeting layer and the RTC layer to the backend carry Accept-Language, and the messages of backend business errors (codes ≥ 1000) come back in Chinese or English accordingly; the SDK’s own errors are always in English and aren’t affected.

Common sources of unauthorized

This is the error you’re most likely to run into, and it almost always comes from room policies: We recommend graying out buttons in the UI in advance based on RoomInfo, rather than letting users tap them and then get an error.
Key points:
  • Besides SMeetingError, the RTC layer’s SRTCError is also thrown unchanged; handle both
  • The pre-call network check networkCheck (since 1.11.0) also passes SRTC-layer codes through: a check already running is alreadyJoined (005), cancelled is cancelled (026), invalid parameters are invalidArgument (031); only when not logged in and using the overload without parameters does it throw the meeting layer’s notLoggedIn (001)
  • For messages shown to end users, map baseCode to your own text; use error.localizedDescription when writing logs, because it includes the error code
  • SMeetingError conforms to Equatable, so you can compare it directly with a specific case; it’s distributed with library evolution enabled, and later versions may add cases, so keep a default branch in your switch

APIs that don’t throw

The following APIs are designed not to throw, so you can call them directly; repeated calls or calls in a mismatched state are safely ignored:
  • logout()
  • exitRoom()
  • closeMic() / closeCamera() / stopShare()
  • disableIm()
  • toggleRemoteAudioMute(_:)
  • getRoomInfo() / getWhiteBoard() / getUsersInfo() / getUsersInfoList() / getRemoteVideoTrack(uid:desc:) / getDevices(kind:)