Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nickybondarenko committed Jul 15, 2024
1 parent 4596c83 commit aba3ac5
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions Sources/Confidence/RemoteResolveConfidenceClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ class RemoteConfidenceResolveClient: ConfidenceResolveClient {
)

do {
let result: HttpClientResult<ResolveFlagsResponse> =
try await self.httpClient.post(path: ":resolve", data: request)
switch result {
case .success(let successData):
guard successData.response.status == .ok else {
throw successData.response.mapStatusToError(error: successData.decodedError)
}
guard let response = successData.decodedData else {
throw ConfidenceError.parseError(message: "Unable to parse request response")
}
let resolvedValues = try response.resolvedFlags.map { resolvedFlag in
try convert(resolvedFlag: resolvedFlag)
}
return ResolvesResult(resolvedValues: resolvedValues, resolveToken: response.resolveToken)
case .failure(let errorData):
throw handleError(error: errorData)
}
let result: HttpClientResult<ResolveFlagsResponse> =
try await self.httpClient.post(path: ":resolve", data: request)
switch result {
case .success(let successData):
guard successData.response.status == .ok else {
throw successData.response.mapStatusToError(error: successData.decodedError)
}
guard let response = successData.decodedData else {
throw ConfidenceError.parseError(message: "Unable to parse request response")
}
let resolvedValues = try response.resolvedFlags.map { resolvedFlag in
try convert(resolvedFlag: resolvedFlag)
}
return ResolvesResult(resolvedValues: resolvedValues, resolveToken: response.resolveToken)
case .failure(let errorData):
throw handleError(error: errorData)
}
}
}

public func resolve(ctx: ConfidenceStruct) async throws -> ResolvesResult {
Expand Down

0 comments on commit aba3ac5

Please sign in to comment.