Aller au contenu

FrakError

Ce contenu n’est pas encore disponible dans votre langue.

enum FrakError

Every failure the SDK can hand back.

Conforms to Foundation.LocalizedError, Swift.Copyable, Swift.Error, Swift.Escapable, Swift.Sendable

Defined in: Sources/FrakSDK/Core/FrakError.swift:4

case alreadyPresenting

A sharing sheet was presented while one was already up.

case backingOff(retryAfterSeconds: TimeInterval)

This resource is in a backoff window, so nothing was sent — unlike network, where a request was attempted. Any cached copy is served in preference to raising this.

case decoding(message: String)

A 2xx response arrived but could not be read as the shape we expect.

case internalFailure(message: String)

A failure inside the SDK: an unexpected error that escaped an internal boundary, or a device capability it needs and cannot get. Not decoding, which describes a backend body.

FrakError.merchantResolutionFailed(reason:)

Section titled “FrakError.merchantResolutionFailed(reason:)”
case merchantResolutionFailed(reason: String)

No merchant could be identified for this app.

case network(underlying: any Error)

The request never reached the backend, or the response never came back.

case notInitialized

A client method was reached before Frak.initialize(_:).

FrakError.server(status:code:retryAfterSeconds:)

Section titled “FrakError.server(status:code:retryAfterSeconds:)”
case server(status: Int, code: String?, retryAfterSeconds: Int?)

The backend answered with a non-2xx status.

case trackingDisabled

A tracking call was made while tracking is not permitted — either because this build ships FrakConfig(trackingEnabled: false) or because FrakClient.setTrackingEnabled(false) was called at runtime. Not raised by config or reward resolution, which are deliberately ungated.

var errorDescription: String? { get }

A localized message describing what error occurred.

var failureReason: String? { get }

A localized message describing the reason for the failure.

var helpAnchor: String? { get }

A localized message providing “help” text if the user requests help.

var kind: FrakError.Kind { get }
var localizedDescription: String { get }

Retrieve the localized description for this error.

var recoverySuggestion: String? { get }

A localized message describing how one might recover from the failure.