1GeoIP2::Error::IPAddresUssNeortFCoounntdr(i3b)uted PerlGDeoocIuPm2e:n:tEartrioorn::IPAddressNotFound(3)
2
3
4
6 GeoIP2::Error::IPAddressNotFound - An exception thrown when an IP
7 address is not in the MaxMind GeoIP2 database
8
10 version 2.006002
11
13 use 5.008;
14
15 use GeoIP2::WebService::Client;
16 use Scalar::Util qw( blessed );
17 use Try::Tiny;
18
19 my $client = GeoIP2::WebService::Client->new(
20 account_id => 42,
21 license_key => 'abcdef123456',
22 );
23
24 try {
25 $client->insights( ip => '24.24.24.24' );
26 }
27 catch {
28 die $_ unless blessed $_;
29 if ( $_->isa('GeoIP2::Error::IPAddressNotFound') ) {
30 log_ip_address_not_found_error( ip_address => $_->ip_address() );
31 }
32
33 # handle other exceptions
34 };
35
37 This class represents an error that occurs when an IP address is not
38 found in the MaxMind GeoIP2 database, either through a web service or a
39 local database.
40
42 The "$error->message()", and "$error->stack_trace()" methods are
43 inherited from Throwable::Error. It also provide two methods of its
44 own:
45
46 $error->ip_address()
47 Returns the IP address that could not be found.
48
50 Bugs may be submitted through
51 <https://github.com/maxmind/GeoIP2-perl/issues>.
52
54 • Dave Rolsky <drolsky@maxmind.com>
55
56 • Greg Oschwald <goschwald@maxmind.com>
57
58 • Mark Fowler <mfowler@maxmind.com>
59
60 • Olaf Alders <oalders@maxmind.com>
61
63 This software is copyright (c) 2013 - 2019 by MaxMind, Inc.
64
65 This is free software; you can redistribute it and/or modify it under
66 the same terms as the Perl 5 programming language system itself.
67
68
69
70perl v5.32.1 2021-01-27GeoIP2::Error::IPAddressNotFound(3)