mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-04-17 22:49:41 +02:00
WIP: prevent error when adding non-existent file
This commit is contained in:
@@ -282,9 +282,12 @@ public extension DataStack {
|
|||||||
options: storage.storeOptions
|
options: storage.storeOptions
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
catch let error as NSError where error.code == NSFileReadNoSuchFileError && error.domain == NSCocoaErrorDomain {
|
||||||
|
|
||||||
|
return []
|
||||||
|
}
|
||||||
catch {
|
catch {
|
||||||
|
|
||||||
// TODO: throws when file not exists yet
|
|
||||||
CoreStore.handleError(
|
CoreStore.handleError(
|
||||||
error as NSError,
|
error as NSError,
|
||||||
"Failed to load \(typeName(storage)) metadata from URL \"\(fileURL)\"."
|
"Failed to load \(typeName(storage)) metadata from URL \"\(fileURL)\"."
|
||||||
|
|||||||
Reference in New Issue
Block a user