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