SRTCError. It isn’t a traditional table of integer error codes, but a Swift enum with semantic cases.
The benefits of this design:
- Callers can branch directly on the error category
- Error info can carry a context string
- It fits Swift’s
try / catchstyle better than plain integer codes
Connection
Signaling
WebRTC / transport
Tracks and capture
Engine and general errors
Virtual background
For usage, see Virtual background (Chinese).
Recommended error handling
SRTCError to your own error domain rather than exposing the English localizedDescription directly to end users.