Improve error handling and fix decoding problem #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request resolves an error occurring on GeoLite2 City databases where some IP-Addresses could not be resolved properly and always returned a read error.
The issue there was, as far as I can tell, in the handling of pointers. However, I took the liberty to rewrite some parts of the decoder and restructured the entire codebase into multiple structs and files for (in my opinion) better readability.
While doing that I also added better error handling with a
MMDBError
enum
that is thrown when encountering errors instead of returningnil
orfatalError
.All tests finish as before but I wrapped the tests supposed to fail with
XCTAssertThrowsError
so the test itself is marked as successful.Finally I would like to thank you for the effort you put into this amazing project and hope you can incorporate the suggested changes.