GeoIP2...r::Type(3pm)
π GeoIP2::Error::Type β the manual, but make it cute π
okay bestie, so this page lives in the User Contributed Perl Documentation corner of the internet, and the module we're talking about is literally called GeoIP2::Error::Type. It's giving "your type didn't pass the vibe check" energy, and I'm obsessed.
β¨ NAME β¨
GeoIP2::Error::Type β a type validation error. That's it, that's the name, she's simple and she's iconic π
πΈ VERSION πΈ
version 2.006002 β write it down, screenshot it, tattoo it, whatever works for you π
π¦ SYNOPSIS π¦
here's the whole thing, verbatim, don't touch a single character bestie:
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::Type') ) {
log_validation_error(
type => $_->name(),
value => $_->value(),
);
}
# handle other exceptions
};
like, you wrap the call in try, and in the catch you check whether the thing you caught is even blessed at all β and if it is, and if it isa('GeoIP2::Error::Type'), you log the name and the value and move on with your life. no cap π«Ά
π DESCRIPTION π
so this class? she represents a Moo type validation error. She extends Throwable::Error and then adds some attributes of her very own, because why just be a Throwable when you can be that girl β¨
π METHODS π
listen, $error->message() and $error->stack_trace() are both inherited from Throwable::Error β you get those for free, they came with the outfit. But she also provides two methods of her own:
π $error->name()
Returns the name of the type which failed validation. That's the "who are you supposed to be" of the situation.
π $error->value()
Returns the value which triggered the validation failure. That's the "what did you actually show up wearing" of the situation. π
π SUPPORT π
Got bugs? Same. Submit them through <https://github.com/maxmind/GeoIP2-perl/issues> and the maintainers will handle it β that's the whole support pipeline, no extra steps, periodt.
π§ AUTHORS π§
these are the legends who made this happen, show them some respect:
- Dave Rolsky <drolsky@maxmind.com>
- Greg Oschwald <goschwald@maxmind.com>
- Mark Fowler <mfowler@maxmind.com>
- Olaf Alders <oalders@maxmind.com>
πΈ 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. So like, go forth, remix, redistribute, slay π
ngl, that's the whole page β every flag, method, author and legal line, all accounted for. nothing skipped, nothing invented, we ate and left no crumbs π«Ά
and that's a wrap bestie!! this beauty was rendered by perl v5.36.0 and stamped 2022-11-21, and the manual page name is GeoIP2::Error::Type(3pm). love that for her πβ¨ππ¦
π¦ 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