@@ -59,65 +59,65 @@ public enum CoreDataError: Error, Hashable, Sendable {
5959 public var localizedDescription : String {
6060 switch self {
6161 case . failedToGetObjectIdFromUrl:
62- return NSLocalizedString (
62+ NSLocalizedString (
6363 " No NSManagedObjectID found that correlates to the provided URL. " ,
6464 bundle: . module,
6565 comment: " Error for when an ObjectID can't be found for the provided URL. "
6666 )
6767 case . propertyDoesNotMatchEntity:
68- return NSLocalizedString (
68+ NSLocalizedString (
6969 " There is a mismatch between a provided NSPropertyDescrption's entity and a NSEntityDescription. "
7070 + " When a property description is provided, it must match any related entity descriptions. " ,
7171 bundle: . module,
7272 comment: " Error for when the developer does not provide a valid pair of NSAttributeDescription "
7373 + " and NSPropertyDescription (or any of their child types). "
7474 )
7575 case . fetchedObjectFailedToCastToExpectedType:
76- return NSLocalizedString (
76+ NSLocalizedString (
7777 " The object corresponding to the provided NSManagedObjectID is an incorrect Entity or "
7878 + " NSManagedObject subtype. It failed to cast to the requested type. " ,
7979 bundle: . module,
8080 comment: " Error for when an object is found for a given ObjectID but it is not the expected type. "
8181 )
8282 case . fetchedObjectIsFlaggedAsDeleted:
83- return NSLocalizedString (
83+ NSLocalizedString (
8484 " The object corresponding to the provided NSManagedObjectID is deleted and cannot be fetched. " ,
8585 bundle: . module,
8686 comment: " Error for when an object is fetched but is flagged as deleted and is no longer usable. "
8787 )
8888 case let . cocoa( error) :
89- return error. localizedDescription
89+ error. localizedDescription
9090 case let . unknown( error) :
91- return error. localizedDescription
91+ error. localizedDescription
9292 case . noEntityNameFound:
93- return NSLocalizedString (
93+ NSLocalizedString (
9494 " The managed object entity description does not have a name. " ,
9595 bundle: . module,
9696 comment: " Error for when the NSEntityDescription does not have a name. "
9797 )
9898 case . atLeastOneAttributeDescRequired:
99- return NSLocalizedString (
99+ NSLocalizedString (
100100 " The managed object entity has no attribute description. An attribute description is required for "
101101 + " aggregate operations. " ,
102102 bundle: . module,
103103 comment: " Error for when the NSEntityDescription has no NSAttributeDescription but one is required. "
104104 )
105105 case . noUrlOnItemToMapToObjectId:
106- return NSLocalizedString (
106+ NSLocalizedString (
107107 " No object ID URL found on the model for an operation against an existing managed object. " ,
108108 bundle: . module,
109109 comment: " Error for performing an operation against an existing NSManagedObject but the "
110110 + " ManagedIdUrlReferencable instance has no managedIdUrl for looking up the NSManagedOjbectID. "
111111 )
112112 case . noObjectIdOnItem:
113- return NSLocalizedString (
113+ NSLocalizedString (
114114 " No object ID found on the model for an operation against an existing managed object. " ,
115115 bundle: . module,
116116 comment: " Error for performing an operation against an existing NSManagedObject but the "
117117 + " ManagedIdReferencable instance has no managedId. "
118118 )
119119 case . noMatchFoundWhenReadingItem:
120- return NSLocalizedString (
120+ NSLocalizedString (
121121 " No match found when attempting to read an instance from CoreData. " ,
122122 bundle: . module,
123123 comment: " Error for reading an instance from CoreData but no instance was found. "
@@ -133,27 +133,27 @@ extension CoreDataError: CustomNSError {
133133 public var errorCode : Int {
134134 switch self {
135135 case . failedToGetObjectIdFromUrl:
136- return 1
136+ 1
137137 case . propertyDoesNotMatchEntity:
138- return 2
138+ 2
139139 case . fetchedObjectFailedToCastToExpectedType:
140- return 3
140+ 3
141141 case . fetchedObjectIsFlaggedAsDeleted:
142- return 4
142+ 4
143143 case . cocoa:
144- return 5
144+ 5
145145 case . unknown:
146- return 6
146+ 6
147147 case . noEntityNameFound:
148- return 7
148+ 7
149149 case . atLeastOneAttributeDescRequired:
150- return 8
150+ 8
151151 case . noUrlOnItemToMapToObjectId:
152- return 9
152+ 9
153153 case . noObjectIdOnItem:
154- return 10
154+ 10
155155 case . noMatchFoundWhenReadingItem:
156- return 11
156+ 11
157157 }
158158 }
159159
@@ -163,27 +163,27 @@ extension CoreDataError: CustomNSError {
163163 public var errorUserInfo : [ String : Any ] {
164164 switch self {
165165 case let . failedToGetObjectIdFromUrl( url) :
166- return [ Self . urlUserInfoKey: url]
166+ [ Self . urlUserInfoKey: url]
167167 case . propertyDoesNotMatchEntity:
168- return [ : ]
168+ [ : ]
169169 case . fetchedObjectFailedToCastToExpectedType:
170- return [ : ]
170+ [ : ]
171171 case . fetchedObjectIsFlaggedAsDeleted:
172- return [ : ]
172+ [ : ]
173173 case let . cocoa( error) :
174- return error. userInfo
174+ error. userInfo
175175 case let . unknown( error) :
176- return error. userInfo
176+ error. userInfo
177177 case . noEntityNameFound:
178- return [ : ]
178+ [ : ]
179179 case . atLeastOneAttributeDescRequired:
180- return [ : ]
180+ [ : ]
181181 case . noUrlOnItemToMapToObjectId:
182- return [ : ]
182+ [ : ]
183183 case . noObjectIdOnItem:
184- return [ : ]
184+ [ : ]
185185 case . noMatchFoundWhenReadingItem:
186- return [ : ]
186+ [ : ]
187187 }
188188 }
189189}
0 commit comments