S1lentium / IPTools

PHP Library for manipulating network addresses (IPv4 and IPv6)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handling generic exceptions

mpaddle opened this issue · comments

When IP::parse(…) and other methods are unable to parse the IP, a generic exception is thrown, which makes it difficult to distinguish between parse exceptions and exceptions that may be due to a missing package.

Would creating and throwing IPTools\ParseException be a decent solution to this? Are there more cases that are currently handled with a generic exception?

I'm happy to provide a PR after discussing the above. The last thing I want to do is introduce poorly-named or poorly-located classes 🙂