Skip to content

Commit

Permalink
Updated missing file handlers to be simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitribouniol committed Oct 8, 2024
1 parent 01fb4cc commit ddfe5e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,7 @@ extension DiskPersistence {

cachedStoreInfo = storeInfo
return storeInfo
} catch URLError.fileDoesNotExist, CocoaError.fileReadNoSuchFile {
return StoreInfo(modificationDate: Date())
} catch let error as NSError where error.domain == NSPOSIXErrorDomain && error.code == Int(POSIXError.ENOENT.rawValue) {
} catch URLError.fileDoesNotExist, CocoaError.fileNoSuchFile, CocoaError.fileReadNoSuchFile, POSIXError.ENOENT {
return StoreInfo(modificationDate: Date())
} catch {
throw error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ extension Snapshot {

cachedManifest = manifest
return manifest
} catch URLError.fileDoesNotExist, CocoaError.fileReadNoSuchFile {
return SnapshotManifest(id: id, modificationDate: Date())
} catch let error as NSError where error.domain == NSPOSIXErrorDomain && error.code == Int(POSIXError.ENOENT.rawValue) {
} catch URLError.fileDoesNotExist, CocoaError.fileNoSuchFile, CocoaError.fileReadNoSuchFile, POSIXError.ENOENT {
return SnapshotManifest(id: id, modificationDate: Date())
} catch {
throw error
Expand Down

0 comments on commit ddfe5e3

Please sign in to comment.