File Coverage

blib/lib/WebService/MinFraud/Error/Generic.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package WebService::MinFraud::Error::Generic;
2              
3 1     1   8 use Moo;
  1         2  
  1         10  
4 1     1   386 use namespace::autoclean;
  1         3  
  1         14  
5              
6             our $VERSION = '1.009001';
7              
8             extends 'Throwable::Error';
9              
10             1;
11              
12             # ABSTRACT: A generic exception class for WebService::MinFraud errors
13              
14             __END__
15              
16             =pod
17              
18             =encoding UTF-8
19              
20             =head1 NAME
21              
22             WebService::MinFraud::Error::Generic - A generic exception class for WebService::MinFraud errors
23              
24             =head1 VERSION
25              
26             version 1.009001
27              
28             =head1 SYNOPSIS
29              
30             use 5.010;
31              
32             use WebService::MinFraud::Client;
33              
34             use Scalar::Util qw( blessed );
35             use Try::Tiny;
36              
37             my $client = WebService::MinFraud::Client->new(
38             account_id => 42,
39             license_key => 'abcdef123456',
40             );
41              
42             try {
43             my $request = { device => { ip_address => '24.24.24.24' } };
44             $client->insights( $request );
45             }
46             catch {
47             die $_ unless blessed $_;
48             die $_ if $_->isa('WebService::MinFraud::Error::Generic');
49              
50             # handle other exceptions
51             };
52              
53             =head1 DESCRIPTION
54              
55             This class represents a generic error. It extends L<Throwable::Error> and does
56             not add any additional attributes.
57              
58             =head1 METHODS
59              
60             This class has two methods, both of which are inherited from
61             L<Throwable::Error>.
62              
63             =head2 message
64              
65             =head2 stack_trace
66              
67             =head1 SUPPORT
68              
69             Bugs may be submitted through L<https://github.com/maxmind/minfraud-api-perl/issues>.
70              
71             =head1 AUTHOR
72              
73             Mateu Hunter <mhunter@maxmind.com>
74              
75             =head1 COPYRIGHT AND LICENSE
76              
77             This software is copyright (c) 2015 - 2019 by MaxMind, Inc.
78              
79             This is free software; you can redistribute it and/or modify it under
80             the same terms as the Perl 5 programming language system itself.
81              
82             =cut