File Coverage

blib/lib/Net/API/RPX/Exception/Service.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 26 26 100.0


line stmt bran cond sub pod time code
1 4     4   457 use 5.006;
  4         13  
2 4     4   21 use strict;
  4         8  
  4         101  
3 4     4   20 use warnings;
  4         7  
  4         339  
4              
5             package Net::API::RPX::Exception::Service;
6              
7             # ABSTRACT: A Class of exceptions for delivering problems from the RPX service.
8              
9             our $VERSION = '1.000001';
10              
11             our $AUTHORITY = 'cpan:KONOBI'; # AUTHORITY
12              
13 4     4   454 use Moose qw( has extends );
  4         422592  
  4         28  
14 4     4   22393 use namespace::autoclean;
  4         6865  
  4         33  
15              
16             extends 'Net::API::RPX::Exception';
17              
18             my $rpx_errors = {
19             -1 => 'Service Temporarily Unavailable',
20             0 => 'Missing parameter',
21             1 => 'Invalid parameter',
22             2 => 'Data not found',
23             3 => 'Authentication error',
24             4 => 'Facebook Error',
25             5 => 'Mapping exists',
26             };
27              
28             has 'data' => ( isa => 'Any', is => 'ro', required => 1 );
29             has 'status' => ( isa => 'Any', is => 'ro', required => 1 );
30             has 'rpx_error' => ( isa => 'Any', is => 'ro', required => 1 );
31             has 'rpx_error_code' => ( isa => 'Any', is => 'ro', required => 1 );
32             has 'rpx_error_message' => ( isa => 'Any', is => 'ro', required => 1 );
33             has
34             'rpx_error_code_description' => ( isa => 'Any', is => 'ro', required => 1, lazy => 1, ),
35             , builder => '_build_rpx_error_code_description';
36              
37             __PACKAGE__->meta->make_immutable( inline_constructor => 0 );
38 4     4   835 no Moose;
  4         9  
  4         22  
39              
40             sub _build_rpx_error_code_description {
41 1     1   3 my ($self) = shift;
42 1         45 return $rpx_errors->{ $self->rpx_error_code };
43             }
44             1;
45              
46             __END__
47              
48             =pod
49              
50             =encoding UTF-8
51              
52             =head1 NAME
53              
54             Net::API::RPX::Exception::Service - A Class of exceptions for delivering problems from the RPX service.
55              
56             =head1 VERSION
57              
58             version 1.000001
59              
60             =head1 AUTHORS
61              
62             =over 4
63              
64             =item *
65              
66             Scott McWhirter <konobi@cpan.org>
67              
68             =item *
69              
70             Kent Fredric <kentnl@cpan.org>
71              
72             =back
73              
74             =head1 COPYRIGHT AND LICENSE
75              
76             This software is Copyright (c) 2017 by Cloudtone Studios.
77              
78             This is free software, licensed under:
79              
80             The (three-clause) BSD License
81              
82             =cut