GeoIP2...tFound(3pm)
π NAME π
GeoIP2::Error::IPAddressNotFound β bestie, it's the exception that gets thrown when an IP address is literally not in the MaxMind GeoIP2 database. She's a 3pm manual page (Perl module docs, iykyk) and she's here to tell you exactly which IP ghosted the database.
β¨ VERSION β¨
version 2.006002 β that's the one, no cap.
πΈ SYNOPSIS πΈ
okay so here's the whole vibe, copy-paste ready:
use 5.008;
use GeoIP2::WebService::Client;
use Scalar::Util qw( blessed );
use Try::Tiny;
my $client = GeoIP2::WebService::Client->new(
account_id => 42,
license_key => 'abcdef123456',
);
try {
$client->insights( ip => '24.24.24.24' );
}
catch {
die $_ unless blessed $_;
if ( $_->isa('GeoIP2::Error::IPAddressNotFound') ) {
log_ip_address_not_found_error( ip_address => $_->ip_address() );
}
# handle other exceptions
};
like, you try the lookup, and if the IP is not found you catch the exception, vibe check it with blessed, and if it isa('GeoIP2::Error::IPAddressNotFound') you grab the offending address and log it. otherwise you die and let somebody else deal. π
π¦ DESCRIPTION π¦
This class represents an error that occurs when an IP address is not found in the MaxMind GeoIP2 database β and yes, that applies whether you're hitting a web service or a local database. Both routes, same dramatic energy. π«Ά
π METHODS π
The $error->message() and $error->stack_trace() methods are inherited from Throwable::Error (iconic of them, honestly). It also provide two methods of its own:
$error->ip_address()
Returns the IP address that could not be found. that's it, that's the whole method, and she ate. π
π SUPPORT π
Bugs may be submitted through <https://github.com/maxmind/GeoIP2-perl/issues>. please be nice and include the deets, bestie π
π AUTHORS π
- Dave Rolsky <drolsky@maxmind.com>
- Greg Oschwald <goschwald@maxmind.com>
- Mark Fowler <mfowler@maxmind.com>
- Olaf Alders <oalders@maxmind.com>
absolute legends, all four of them β
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2013 - 2019 by MaxMind, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
ngl that license is the friendliest thing you'll ever read β do what you want, just keep the same terms as Perl 5 itself. periodt. π
and that's the whole page, bestie!! this cutie came to you from perl v5.36.0, dated 2022-11-21, and she lives her life as GeoIP2...tFound(3pm) β the manual page formerly known as the full GeoIP2::Error::IPAddressNotFound name, which got a lil truncated for the header because terminals are rude. go find some IPs, bestie, and may they all be found πβ¨
π¦ where this page comes from
- debian bookworm: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms