GeoIP2...r::HTTP(3pm)
π NAME π
GeoIP2::Error::HTTP β an HTTP transport error, bestie. that's it, that's the vibe π¦
β¨ VERSION β¨
version 2.006002 β yes she's specific, she's got receipts π
πΈ SYNOPSIS πΈ
okay so here's the whole thing in action, no cap:
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::HTTP') ) {
log_http_error(
status => $_->http_status(),
uri => $_->uri(),
);
}
# handle other exceptions
};
like literally just try it, and if it's an HTTP-shaped oopsie you catch it and log it. the die $_ unless blessed $_ line is doing the "is this even an object" vibe check π«Ά
π DESCRIPTION π
so this class? it represents an HTTP transport error. it extends Throwable::Error and then adds some attributes of its very own, because why be basic when you can be extra π
π METHODS π
the $error->message() and $error->stack_trace() methods are inherited from Throwable::Error β not her own work, she's just repping the family. but she also provides two methods of her own, and they are iconic:
π $error->http_status()
returns the HTTP status. and it should be either a 4xx or 5xx error. so like, either you did something wrong or they did. either way, drama. π
π $error->uri()
returns the URI which gave the HTTP error. the exact address that said "no <3" β she remembers everything π
π SUPPORT π
bugs? not the vibe, but if you found one, may be submitted through:
<https://github.com/maxmind/GeoIP2-perl/issues>
(go off, tell them everything, they wanna know π)
π¦ AUTHORS π¦
these absolute legends made this:
- Dave Rolsky
<drolsky@maxmind.com> - Greg Oschwald
<goschwald@maxmind.com> - Mark Fowler
<mfowler@maxmind.com> - Olaf Alders
<oalders@maxmind.com>
four icons, one module. main character energy all around π
π 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. slay, open source, periodt β¨
ngl bestie, if you got a 4xx or a 5xx from an HTTP transport call, this is the girl who catches it and tells you exactly where and how bad. she's the group chat screenshot of errors. obsessed ππ«Ά
perl v5.36.0 Β· 2022-11-21 β yeah that's the version and the date this page was blessed into existence, and that's the whole manual, no crumbs left, mwah ππ
π¦ 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