File Coverage

blib/lib/Geo/Location/IP/Error/Generic.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 2 3 66.6
total 30 31 96.7


line stmt bran cond sub pod time code
1             package Geo::Location::IP::Error::Generic;
2              
3             # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
4              
5 10     10   179 use 5.026;
  10         45  
6 10     10   55 use warnings;
  10         23  
  10         500  
7 10     10   49 use utf8;
  10         19  
  10         71  
8              
9 10     10   302 use Object::Pad;
  10         19  
  10         61  
10              
11             class Geo::Location::IP::Error::Generic;
12              
13             our $VERSION = 0.005;
14              
15 28     28 1 86 field $message :param :reader;
  28         153  
16              
17             sub throw {
18 35     35 1 115 my ($class, @params) = @_;
19              
20 35         339 die $class->new(@params);
21             }
22              
23             use overload
24 10     10   5871 q{""} => \&stringify;
  10         25  
  10         108  
25              
26             sub stringify {
27 28     28 0 8518 my $self = shift;
28              
29 28         85 return $self->message;
30             }
31              
32             1;
33             __END__