From 682c7b1e3e0abb2c1f8d1cec97758b43604c1e3f Mon Sep 17 00:00:00 2001 From: dankinsoid <30962149+dankinsoid@users.noreply.github.com> Date: Sun, 18 Aug 2024 13:07:01 +0400 Subject: [PATCH] 1.37.0 --- Sources/SwiftAPIClient/APIClientCaller.swift | 1 + Sources/SwiftAPIClient/Clients/HTTPClient.swift | 1 + 2 files changed, 2 insertions(+) diff --git a/Sources/SwiftAPIClient/APIClientCaller.swift b/Sources/SwiftAPIClient/APIClientCaller.swift index 7c6e6d2..269c1e6 100644 --- a/Sources/SwiftAPIClient/APIClientCaller.swift +++ b/Sources/SwiftAPIClient/APIClientCaller.swift @@ -243,6 +243,7 @@ public extension APIClient { } catch { try withConfigs { configs in let fileIDLine = configs.fileIDLine ?? FileIDLine(fileID: fileID, line: line) + let configs = configs.with(\.fileIDLine, fileIDLine) if !configs._errorLoggingComponents.isEmpty { let message = configs._errorLoggingComponents.errorMessage( uuid: uuid, diff --git a/Sources/SwiftAPIClient/Clients/HTTPClient.swift b/Sources/SwiftAPIClient/Clients/HTTPClient.swift index 187af6a..73bc2a1 100644 --- a/Sources/SwiftAPIClient/Clients/HTTPClient.swift +++ b/Sources/SwiftAPIClient/Clients/HTTPClient.swift @@ -134,6 +134,7 @@ extension APIClientCaller where Result == AsyncThrowingValue<(Value, HTTPRespons if configs.reportMetrics { updateHTTPMetrics(for: request, status: nil, duration: duration, successful: false) } + try configs.errorHandler(error, configs, APIErrorContext(request: request, fileIDLine: configs.fileIDLine ?? FileIDLine())) throw error } let duration = Date().timeIntervalSince(start)