Added new error for cases when addStorageAndWait() is used with .allowSynchronousLightweightMigration but migrations are only allowed asynchronously (related to #277)

This commit is contained in:
John Estropia
2018-12-05 16:15:20 +09:00
parent 06c0981ded
commit cc346816d6
4 changed files with 54 additions and 0 deletions

View File

@@ -217,6 +217,17 @@ extension CoreStoreError: CoreStoreSwiftType, _ObjectiveCBridgeableError {
return
}
self = .progressiveMigrationRequired(localStoreURL: localStoreURL)
case .asynchronousMigrationRequired:
guard
let localStoreURL = info["localStoreURL"] as? URL,
case let nsError as NSError = info["NSError"]
else {
self = .unknown
return
}
self = .asynchronousMigrationRequired(localStoreURL: localStoreURL, NSError: nsError)
case .internalError:
guard case let nsError as NSError = info["NSError"] else {