do {
let attribution = try await SpendOwl.attribution()
handleAttribution(attribution)
} catch SpendOwlError.notConfigured {
// SDK not configured
SpendOwl.configure(apiKey: "your-api-key")
// Retry
} catch SpendOwlError.invalidAPIKey {
// Wrong API key - log and alert
logger.error("Invalid SpendOwl API key")
} catch SpendOwlError.networkError {
// Network issue - will be retried automatically
// Consider showing offline indicator
} catch SpendOwlError.serverError(let code, _) where code >= 500 {
// Server issue - temporary, will resolve
} catch SpendOwlError.attributionUnavailable {
// Device doesn't support attribution
// Continue without attribution data
} catch SpendOwlError.attributionDenied {
// User has tracking disabled
// Continue without attribution data
} catch {
// Unknown error
logger.error("Attribution error: \(error)")
}