You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That code should work. Is it possible that you have an exception class in your namespace called Exception? You could try changing catch (Exception $e) to catch (\Exception $e).
As a best practice, I would suggest catching GeoIp2\Exception\AddressNotFoundException specifically rather than trying to catch all exceptions.
Wow, I was focused only in Exception, and I completely forgot to escape it from current namespace.
I had an if clause inside the catch to manage GeoIp2\Exception\AddressNotFoundException, that was my mistake, because it provoked me to unfocus in Exception.
Hi guys,
I've been trying by infinite ways to catch this exception.
The exception comes from https://github.com/maxmind/GeoIP2-php/blob/master/src/GeoIp2/Database/Reader.php#L167
This is not catching the exception:
I've tried a lot of things, but anything works.... :(
However, this simple try codeblock I pasted above should work, right?
Am I doing anything wrong? How can I catch that exception?
The text was updated successfully, but these errors were encountered: