diff --git a/GiteaPR/Networking/GiteaClient.swift b/GiteaPR/Networking/GiteaClient.swift index 5509701..1fff7bc 100644 --- a/GiteaPR/Networking/GiteaClient.swift +++ b/GiteaPR/Networking/GiteaClient.swift @@ -78,23 +78,23 @@ struct GiteaClient { let (data, response) = try await session.data(for: req) guard let http = response as? HTTPURLResponse else { - LogStore.shared.log(.error, "\(method) \(path) → invalid response") + await LogStore.shared.log(.error, "\(method) \(path) → invalid response") throw APIError.invalidResponse } switch http.statusCode { case 200...299: - LogStore.shared.log(.info, "\(method) \(path) → \(http.statusCode)") + await LogStore.shared.log(.info, "\(method) \(path) → \(http.statusCode)") return data case 401, 403: - LogStore.shared.log(.error, "\(method) \(path) → \(http.statusCode) unauthorized") + await LogStore.shared.log(.error, "\(method) \(path) → \(http.statusCode) unauthorized") throw APIError.unauthorized case 404: - LogStore.shared.log(.error, "\(method) \(path) → 404 not found") + await LogStore.shared.log(.error, "\(method) \(path) → 404 not found") throw APIError.notFound default: let message = (try? Self.decoder.decode([String: String].self, from: data))?["message"] - LogStore.shared.log(.error, "\(method) \(path) → \(http.statusCode) \(message ?? "")") + await LogStore.shared.log(.error, "\(method) \(path) → \(http.statusCode) \(message ?? "")") throw APIError.httpStatus(http.statusCode, message) } }