int all use the five values below: RTC_OK is 0, and every failure is negative.
Values
RTC_ERROR is a catch-all failure code. Get the specific reason with rtc_get_last_error (since 0.0.9); it returns the 180xxx / 1xxx error codes described in the next two sections. You can also raise the log level to see the reason:180001: Not in channel or 1021: .... The difference between these two kinds of codes is explained in the next two sections.180xxx in logs: SDK errors
The five C return values only describe the result “at the call level” and carry no reason. Get the reason with rtc_get_last_error; it is also printed in the logs. 6-digit codes starting with 180 are errors produced by the SDK itself: 180 is the prefix for server-side / embedded integrations, and the last three digits identify the specific error and are the same across all SDKs (see Error code format for the numbering rules). Reasons for SDK errors are in English; branch on the error code, not on the message text.
1xxx and similar in logs: server business error codes
Four-digit codes (≥1000) come from the server. They are business-level reasons for rejection, passed through unchanged by the SDK, for example:
For the full list, see Server API · Error codes. When a publish / subscribe is rejected by the server (such as
1033 concurrency limit reached or 1035 node overloaded), rtc_get_last_error returns the server code as-is since 0.1.0 instead of wrapping it as 180300 / 180301.
The language of server error reasons is set by rtc_set_language; by default it follows the system language.
Checking return values
Check the return value of every function that returnsint. When a critical path such as joining the channel fails, you must run the cleanup flow to avoid leaking handles:
rtc_create / rtc_create_local_track return pointers, which are NULL on failure; just check for NULL.