placemarkt / address-formatter-java

Maven package for formatting data in the OpenStreetMaps address field generated by the Nominatim API.
MIT License
7 stars 0 forks source link

Use of generic "throw Error" #12

Open felix0908 opened 2 weeks ago

felix0908 commented 2 weeks ago

Hi there! Your project's been pretty helpful, so thanks for making it.

I was wondering if you'd consider replacing your throw new Error() statements with a less generic error, ideally a custom one for this project. That way it's much easier to specifically target these errors in any code making use of this project.

This would for example come in handy when you're batch processing a large number of addresses, and want to log the ones that weren't successfully formatted. While you can currently specify a fallback country code, you wouldn't know whether the fallback was used to format the address or not.

rkoeze commented 6 days ago

Hi @felix0908! Yes, that's an extremely reasonable request. I am in the process of a larger refactor. I will address your concerns there. Thanks for the feedback! Will leave this issue open until it's addressed.

felix0908 commented 4 days ago

Nice! That sounds very promising