Legendary Trio
devlogquedulaapi

Devlog #4: TikTok API error handling

The TikTok API returns different types of errors, and each needs to be handled differently.

We split them into three classes: retriable (transient failures, rate limit), non-retriable (invalid video format, content policy violation), and user-action-required (expired token, revoked access).

For the first class — automatic retry with a pause. For the second — immediately inform the user with a clear description of what's wrong. For the third — a notification asking them to re-authorize.

Errors that the user sees should be written in their language, not the API's language. "error_code: 10007" — bad. "Video is too long, maximum 10 minutes" — good.