File Coverage

blib/lib/App/SpamcupNG/Error/LoginFailed.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 2 2 100.0
total 21 21 100.0


line stmt bran cond sub pod time code
1             use strict;
2 12     12   142 use warnings;
  12         16  
  12         271  
3 12     12   43 use parent 'App::SpamcupNG::Error';
  12         18  
  12         267  
4 12     12   46  
  12         18  
  12         56  
5             our $VERSION = '0.015'; # VERSION
6              
7             =head1 NAME
8              
9             App::SpamcupNG::Error::LoginFailed - an Error subclass that represents a login
10             attempt that failed.
11              
12             =head1 SYNOPSIS
13              
14             See L<App::SpamcupNG::Error::Factory> instead of creating it manually.
15              
16             =head1 DESCRIPTION
17              
18             A login failed means there is a problem with your Spamcop account credentials.
19              
20             =head1 METHODS
21              
22             =head2 new
23              
24             Creates a new instance.
25              
26             Expects as parameter an array reference containing the bounce error message.
27              
28             A instance of this class is always considered as fatal.
29              
30             =cut
31              
32             my ( $class, $message_ref ) = @_;
33             return $class->SUPER::new( $message_ref, 1 );
34 1     1 1 4 }
35 1         11  
36             =head2 message
37              
38             Overrided from the parent class, adding required behavior.
39              
40             =cut
41              
42             my $self = shift;
43             my $additional
44             = ' Also consider obtaining a password to Spamcop.net instead of using '
45 1     1 1 3 . 'the old-style authorization token.';
46 1         2  
47             return join( '.', ( $self->{message}->[0], $additional ) );
48             }
49              
50 1         7 =head1 AUTHOR
51              
52             Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>
53              
54             =head1 COPYRIGHT AND LICENSE
55              
56             This software is copyright (c) 2018 of Alceu Rodrigues de Freitas Junior,
57             E<lt>arfreitas@cpan.orgE<gt>
58              
59             This file is part of App-SpamcupNG distribution.
60              
61             App-SpamcupNG is free software: you can redistribute it and/or modify it under
62             the terms of the GNU General Public License as published by the Free Software
63             Foundation, either version 3 of the License, or (at your option) any later
64             version.
65              
66             App-SpamcupNG is distributed in the hope that it will be useful, but WITHOUT
67             ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
68             FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
69              
70             You should have received a copy of the GNU General Public License along with
71             App-SpamcupNG. If not, see <http://www.gnu.org/licenses/>.
72              
73             =cut
74              
75             1;