use strict;
use warnings;
use Try::Tiny;
use GeoIP2::Database::Reader;
my $countryReader;
try {
print "opening Country\n";
$countryReader = GeoIP2::Database::Reader->new(
file => '/usr/share/GeoIP/GeoIP2-INVALID.mmdb',
locales => ['en']
);
}
catch {
print "Error:" . $_ . "\n";
};
The problem is that the actual error is thrown by the MaxMind::DB::Reader object, which we build lazily. I think we can probably make that attribute non-lazy. Then the file will be checked immediately.
The problem is that the actual error is thrown by the
MaxMind::DB::Reader
object, which we build lazily. I think we can probably make that attribute non-lazy. Then the file will be checked immediately.