SdkError is the SDK’s single error type: code: SdkErrorCode, reason: SdkErrorReason, an
optional human-readable errorMessage, and an optional providerError for social-provider
failures. It conforms to LocalizedError, and its message is automatically redacted — any embedded
JWT or Bearer ... token is replaced with [redacted] before it is ever surfaced to your code or a
log.
Two delivery paths — know which one you’re handling
Configuration errors throw synchronously. Constructing an invalid
RakomiAuthConfiguration throws an SdkError from the initializer —
these are programmer errors and must be caught with ordinary Swift do/catch, not observed on a
stream.
Every runtime auth error is emitted, never thrown.RakomiAuth’s async sign-in/session
methods never throw for an auth-flow failure; they emit AuthState.error(SdkError) on
authStateChanges(). getToken() is one exception — it throws when there is no valid session, so
a caller reaching for a token gets a normal Swift error at the call site.
The top-level classification. Its wire form (used in logging and cross-platform parity) is the
uppercase SCREAMING_SNAKE_CASE shown in the second column.
errorDescription and redactedMessage never contain a raw JWT or Authorization header value —
even one embedded mid-string in a wrapped provider error is scrubbed before it reaches your code.