Skip to main content
Every error the SDK throws extends AuthenticaError. Use instanceof to handle each case.

Error types

Properties

AuthenticaAuthenticationError has the same properties as AuthenticaApiError.

Example

Check subclasses before their parent: AuthenticaAuthenticationError before AuthenticaApiError, and AuthenticaTimeoutError before AuthenticaConnectionError.

Logging errors safely

SDK error messages are written by the SDK and never contain your API key or request data. AuthenticaApiError.errors is the exception: it holds the API’s own text, which can echo values from your request. Log the error name and status, not the whole error:
Do not log entire SDK error objects or error.errors without reviewing what they may contain.

Rate limits (HTTP 429)

When the API responds with HTTP 429, the SDK throws AuthenticaApiError with status 429. If the response includes a valid Retry-After header, retryAfterSeconds holds the wait time in seconds.
The SDK never retries requests automatically. Your application decides whether and when to retry.
Do not blindly retry OTP sends or face and voice verifications. They may not be idempotent: a retried send can deliver a second code and use extra credits. A timeout does not prove a request failed.