| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package GeoIP2::Error::IPAddressNotFound; |
|
2
|
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
48
|
use strict; |
|
|
8
|
|
|
|
|
19
|
|
|
|
8
|
|
|
|
|
204
|
|
|
4
|
8
|
|
|
8
|
|
35
|
use warnings; |
|
|
8
|
|
|
|
|
15
|
|
|
|
8
|
|
|
|
|
258
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '2.006002'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
8
|
|
|
8
|
|
36
|
use Moo; |
|
|
8
|
|
|
|
|
14
|
|
|
|
8
|
|
|
|
|
41
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
8
|
|
|
8
|
|
4660
|
use GeoIP2::Types qw( Str ); |
|
|
8
|
|
|
|
|
20
|
|
|
|
8
|
|
|
|
|
509
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
8
|
|
|
8
|
|
47
|
use namespace::clean -except => 'meta'; |
|
|
8
|
|
|
|
|
16
|
|
|
|
8
|
|
|
|
|
31
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
extends 'Throwable::Error'; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has ip_address => ( |
|
17
|
|
|
|
|
|
|
is => 'ro', |
|
18
|
|
|
|
|
|
|
isa => Str, |
|
19
|
|
|
|
|
|
|
required => 1, |
|
20
|
|
|
|
|
|
|
); |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# ABSTRACT: An exception thrown when an IP address is not in the MaxMind GeoIP2 database |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=pod |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=encoding UTF-8 |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
GeoIP2::Error::IPAddressNotFound - An exception thrown when an IP address is not in the MaxMind GeoIP2 database |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 VERSION |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
version 2.006002 |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
use 5.008; |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
use GeoIP2::WebService::Client; |
|
45
|
|
|
|
|
|
|
use Scalar::Util qw( blessed ); |
|
46
|
|
|
|
|
|
|
use Try::Tiny; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $client = GeoIP2::WebService::Client->new( |
|
49
|
|
|
|
|
|
|
account_id => 42, |
|
50
|
|
|
|
|
|
|
license_key => 'abcdef123456', |
|
51
|
|
|
|
|
|
|
); |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
try { |
|
54
|
|
|
|
|
|
|
$client->insights( ip => '24.24.24.24' ); |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
catch { |
|
57
|
|
|
|
|
|
|
die $_ unless blessed $_; |
|
58
|
|
|
|
|
|
|
if ( $_->isa('GeoIP2::Error::IPAddressNotFound') ) { |
|
59
|
|
|
|
|
|
|
log_ip_address_not_found_error( ip_address => $_->ip_address() ); |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# handle other exceptions |
|
63
|
|
|
|
|
|
|
}; |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This class represents an error that occurs when an IP address is not found in |
|
68
|
|
|
|
|
|
|
the MaxMind GeoIP2 database, either through a web service or a local database. |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 METHODS |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
The C<< $error->message() >>, and C<< $error->stack_trace() >> methods are |
|
73
|
|
|
|
|
|
|
inherited from L<Throwable::Error>. It also provide two methods of its own: |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 $error->ip_address() |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Returns the IP address that could not be found. |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 SUPPORT |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Bugs may be submitted through L<https://github.com/maxmind/GeoIP2-perl/issues>. |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 AUTHORS |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=over 4 |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item * |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Dave Rolsky <drolsky@maxmind.com> |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item * |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Greg Oschwald <goschwald@maxmind.com> |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item * |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Mark Fowler <mfowler@maxmind.com> |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item * |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Olaf Alders <oalders@maxmind.com> |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=back |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
This software is copyright (c) 2013 - 2019 by MaxMind, Inc. |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
110
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=cut |