File Coverage

blib/lib/AnyEvent/XMPP/Error/SASL.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package AnyEvent::XMPP::Error::SASL;
2 1     1   4191 use AnyEvent::XMPP::Error;
  0            
  0            
3             use strict;
4             our @ISA = qw/AnyEvent::XMPP::Error/;
5              
6             =head1 NAME
7              
8             AnyEvent::XMPP::Error::SASL - SASL authentication error
9              
10             Subclass of L
11              
12             =cut
13              
14             sub init {
15             my ($self) = @_;
16             my $node = $self->xml_node;
17              
18             my $error;
19             for ($node->nodes) {
20             $error = $_->name;
21             last
22             }
23              
24             $self->{error_cond} = $error;
25             }
26              
27             =head2 METHODS
28              
29             =over 4
30              
31             =item B
32              
33             Returns the L object for this stream error.
34              
35             =cut
36              
37             sub xml_node {
38             $_[0]->{node}
39             }
40              
41             =item B
42              
43             Returns the error condition, which might be one of:
44              
45             aborted
46             incorrect-encoding
47             invalid-authzid
48             invalid-mechanism
49             mechanism-too-weak
50             not-authorized
51             temporary-auth-failure
52              
53             =cut
54              
55             sub condition {
56             $_[0]->{error_cond}
57             }
58              
59             sub string {
60             my ($self) = @_;
61              
62             sprintf "sasl error: %s",
63             $self->condition
64             }
65              
66             =back
67              
68             =cut
69              
70              
71             =head1 AUTHOR
72              
73             Robin Redeker, C<< >>, JID: C<< >>
74              
75             =head1 COPYRIGHT & LICENSE
76              
77             Copyright 2007, 2008 Robin Redeker, all rights reserved.
78              
79             This program is free software; you can redistribute it and/or modify it
80             under the same terms as Perl itself.
81              
82             =cut
83              
84             1; # End of AnyEvent::XMPP