Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace NSErrors with Error enumeration and Codable Errors #38

Open
mrlegowatch opened this issue Jun 20, 2024 · 0 comments
Open

Replace NSErrors with Error enumeration and Codable Errors #38

mrlegowatch opened this issue Jun 20, 2024 · 0 comments

Comments

@mrlegowatch
Copy link
Owner

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().

  • The use of DecodingError and EncodingError should be extended where appropriate
  • Remaining usage of NSError should be replaced with a GarageError enumeration
  • Ensure that more errors are propagated in APIs such as save(), by reducing or eliminating their catch blocks, and replacing print statements with throw.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant