Skip to content

Commit

Permalink
includ 429 in iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
ndurell committed Apr 1, 2024
1 parent 406ca0b commit 9ddcfe8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/KlaviyoSwift/SDKRequestIterator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public func requestIterator() -> AsyncStream<SDKRequest> {
KlaviyoAPI.requestFailed = { _, _, _ in }
KlaviyoAPI.requestCompleted = { _, _, _ in }
KlaviyoAPI.requestHttpError = { _, _, _ in }
KlaviyoAPI.requestRateLimited = { _ in }
}
KlaviyoAPI.requestStarted = { request in
continuation.yield(SDKRequest.fromAPIRequest(request: request, response: .inProgress))
Expand All @@ -151,5 +152,8 @@ public func requestIterator() -> AsyncStream<SDKRequest> {
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)))
}
}
}

0 comments on commit 9ddcfe8

Please sign in to comment.