mrlegowatch / GarageStorageSwift

A Swift implementation of GarageStorage. Provides a convenient way to store any kind of data in a repository backed by Core Data.
MIT License
8 stars 1 forks source link

Replace NSErrors with Error enumeration and Codable Errors #38

Open mrlegowatch opened 2 months ago

mrlegowatch commented 2 months ago

The initial conversion to Swift retained the implementation of making and throwing NSErrors, which are unwieldy in Swift. Additionally, the specific errors must be parsed from the localizedDescription regardless of language, which is even more unwieldy. The Codable enhancements introduce DecodingError and EncodingError as appropriate, but are limited to contexts where encoders or decoders are "in flight" (the extensions). Lastly, some APIs do not propagate errors, such as save().