IPQualityScore / JavaIPQSDBReader

A java implementation of the IPQualityScore flat file DB Reader.
MIT License
0 stars 3 forks source link

Feature Request: Return null/Optional result instead of an IOException when ip address is not found #4

Open menacher opened 2 years ago

menacher commented 2 years ago

Right now, if we check an IP which does not exist in the file an IOException is thrown. This is not ideal in multiple ways

  1. It is not great design to program by Exception.
  2. It is much less performant than returning a null or Optional result.
java.io.IOException: Invalid or nonexistent IP address specified for lookup. (EID: 12)

    at com.ipqualityscore.JavaIPQSDBReader.FileReader.Fetch(FileReader.java:83)
IPQualityScore commented 2 years ago

Thanks for the feedback. We'll look into this.

dmandelbaum commented 2 months ago

Updating this would be very beneficial for handling expected scenarios