srtc.SdkError, which has the following fields:
code / base_code to tell errors apart, not on the msg text.
code falls into three kinds:
Common errors
For all values of
srtc.ErrorCode and what each code means, see C SDK · Error codes (the value of ErrorCode is the last three digits of the error code).
Language
Themsg of server errors (code ≥1000) is generated by the server, and its language can be set (since 0.2.0):
- Applies process-wide and can be called at any time, including before creating a
Channel - When it isn’t called, the system language is used: the first non-empty value among the environment variables
LC_ALL,LC_MESSAGES, andLANG; when it isC/POSIXor none of them is set, the server replies in Chinese - Only affects the text of server errors; SDK errors (
180xxx) are always in English
Logging
The SDK uses Python’s standardlogging, with the logger name srtc:
logging.