File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,10 @@ public extension APIManager {
125
125
}
126
126
127
127
private extension APIManager {
128
- func request( _ endpointRequest: EndpointRequest , retryConfiguration: RetryConfiguration ? ) async throws -> Response {
128
+ func request(
129
+ _ endpointRequest: EndpointRequest ,
130
+ retryConfiguration: RetryConfiguration ?
131
+ ) async throws -> Response {
129
132
do {
130
133
// create original url request
131
134
var request = try endpointRequest. endpoint. asRequest ( )
@@ -149,8 +152,12 @@ private extension APIManager {
149
152
return response
150
153
} catch {
151
154
do {
152
- // If retry fails (retryCount is 0 or Task.sleep throwed), catch the error and process it with `ErrorProcessing` plugins.
153
- try await sleepIfRetry ( for: error, endpointRequest: endpointRequest, retryConfiguration: retryConfiguration)
155
+ // If retry fails (retryCount is 0 or Task.sleep thrown), catch the error and process it with `ErrorProcessing` plugins.
156
+ try await sleepIfRetry (
157
+ for: error,
158
+ endpointRequest: endpointRequest,
159
+ retryConfiguration: retryConfiguration
160
+ )
154
161
return try await request ( endpointRequest, retryConfiguration: retryConfiguration)
155
162
} catch {
156
163
// error processing
Original file line number Diff line number Diff line change 1
1
import Foundation
2
2
3
3
/// An error in APIManager configuration..
4
- enum APIManagerError : Error {
4
+ public enum APIManagerError : Error {
5
5
/// An indication that the urlSession has been invalidated but not recreated.
6
6
case invalidUrlSession
7
7
}
You can’t perform that action at this time.
0 commit comments