Remove file deletion error

multistore
Laurent 1 year ago
parent 102be89a83
commit 164e63363c
  1. 1
      LeStorage/Services.swift
  2. 2
      LeStorage/StoredCollection.swift

@ -207,7 +207,6 @@ public class Services {
request.httpBody = apiCall.body.data(using: .utf8) request.httpBody = apiCall.body.data(using: .utf8)
request.setValue("application/json", forHTTPHeaderField: "Content-Type") request.setValue("application/json", forHTTPHeaderField: "Content-Type")
if let method = HTTPMethod(rawValue: apiCall.method), self._isTokenRequired(type: T.self, method: method) { if let method = HTTPMethod(rawValue: apiCall.method), self._isTokenRequired(type: T.self, method: method) {
do { do {
let token = try self.keychainStore.getToken() let token = try self.keychainStore.getToken()

@ -352,7 +352,9 @@ public class StoredCollection<T: Storable>: RandomAccessCollection, SomeCollecti
do { do {
let url: URL = try self._urlForJSONFile() let url: URL = try self._urlForJSONFile()
if FileManager.default.fileExists(atPath: url.path()) {
try FileManager.default.removeItem(at: url) try FileManager.default.removeItem(at: url)
}
} catch { } catch {
Logger.error(error) Logger.error(error)
} }

Loading…
Cancel
Save