SMeetingError, a semantic Swift enum that also provides an integer error code.
- Use
switchto branch on meaning - Use
error.codeto get the integer error code, handy for logs and support tickets - Use
error.messageto get a plain-text description error.localizedDescriptionoutputs"<code>: <message>"
Error list
Error code format
SMeetingError.code returns the full, assembled error code:
- Client errors (those in the table above whose client code is less than 1000) get a platform prefix, forming a 6-digit number: the iOS prefix is
203, and the macOS prefix is205 - Errors passed through from the server (
apiErrorwith a server code of 1000 or greater) are kept as-is, without a prefix
This lets you tell at a glance whether an error was “stopped by the client itself” or “returned by the server.”
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.
Recommended handling
- Besides
SMeetingError, the underlying audio and video layer may also throw its own error types (for example, capture failures or connection failures), so don’t omit the catch-allcatchbranch - Prefer
error.messagewhen showing messages to end users; useerror.localizedDescriptionwhen writing logs, because it includes the error code SMeetingErrorconforms toEquatable, so you can compare it directly with a specific case
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:)
Related pages
- Key concepts
- API reference - SMeetingEngine (Chinese)