diff --git a/Sources/KlaviyoSwift/SDKRequestIterator.swift b/Sources/KlaviyoSwift/SDKRequestIterator.swift index 555c667a..78c0f7fe 100644 --- a/Sources/KlaviyoSwift/SDKRequestIterator.swift +++ b/Sources/KlaviyoSwift/SDKRequestIterator.swift @@ -137,6 +137,7 @@ public func requestIterator() -> AsyncStream { KlaviyoAPI.requestFailed = { _, _, _ in } KlaviyoAPI.requestCompleted = { _, _, _ in } KlaviyoAPI.requestHttpError = { _, _, _ in } + KlaviyoAPI.requestRateLimited = { _ in } } KlaviyoAPI.requestStarted = { request in continuation.yield(SDKRequest.fromAPIRequest(request: request, response: .inProgress)) @@ -151,5 +152,8 @@ public func requestIterator() -> AsyncStream { KlaviyoAPI.requestHttpError = { request, statusCode, duration in continuation.yield(SDKRequest.fromAPIRequest(request: request, response: .httpError(statusCode, duration))) } + KlaviyoAPI.requestRateLimited = { request in + continuation.yield(SDKRequest.fromAPIRequest(request: request, response: .reqeustError("Rate Limited", 0.0))) + } } }