|
|
|
|
@ -300,7 +300,14 @@ public class StoreCenter { |
|
|
|
|
let authValue = request.allHTTPHeaderFields?["Authorization"] |
|
|
|
|
let string = try apiCall.jsonString() |
|
|
|
|
let failedAPICall = FailedAPICall(callId: apiCall.id, type: collectionName, apiCall: string, error: error, authentication: authValue) |
|
|
|
|
try failedAPICallsCollection.addOrUpdate(instance: failedAPICall) |
|
|
|
|
|
|
|
|
|
DispatchQueue.main.async { |
|
|
|
|
do { |
|
|
|
|
try failedAPICallsCollection.addOrUpdate(instance: failedAPICall) |
|
|
|
|
} catch { |
|
|
|
|
Logger.error(error) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch { |
|
|
|
|
Logger.error(error) |
|
|
|
|
} |
|
|
|
|
@ -308,7 +315,6 @@ public class StoreCenter { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Logs a failed Api call with its request and error message |
|
|
|
|
|