GeoIP2...tFound(3pm)

πŸ“¦
version 2.006002 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 ⭐


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