Skip to content

Improve error handling and fix decoding problem #2

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

niklhut
Copy link

@niklhut niklhut commented Jan 7, 2023

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 returning nil or fatalError.

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.

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

Successfully merging this pull request may close these issues.

1 participant