Skip to main content
When an API fails it raises srtc.SdkError, which has the following fields:
Branch on code / base_code to tell errors apart, not on the msg text. code falls into three kinds:
Error codes were renumbered in 0.2.0 (for example, invalid argument changed from 180900 to 180031, and “not allowed to publish a composite stream” changed from 180004 to 180040). The table below applies to 0.2.0 and later. For the old-to-new mapping, see Changelog · 0.2.0.

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).
When a join fails, handle it by error code: 1021 / 1032 / 180002 / 180004 are token problems—issue a new token before retrying; 1034 / 1035 / 180006 are temporary—retry later with a new token; 1033 is a license quota problem, and retrying doesn’t help.

Language

The msg 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, and LANG; when it is C / POSIX or 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 standard logging, with the logger name srtc:
Logs from the native core (signaling, media connections) go directly to the process’s stdout / stderr, not through logging.